Interface DocumentProviderBridge
The platform seam of the document provider framework, implemented by ports and returned from
CodenameOneImplementation.getDocumentProviderBridge() (null on unsupported ports, making the
whole public API an inert no-op).
Everything crosses this boundary as data -- a JSON index produced by the core serializer and files on disk -- never as live model objects. On iOS the reader is an app extension in a separate process that runs while the app is dead, so implementations MUST persist what they are given into a container both processes can reach (the App Group container on Apple platforms; ordinary app storage on Android, where the provider shares the app's process).
Nothing here blocks on the platform browser: publishing writes the index, and signalChange
is a hint that the browser should re-enumerate at its own convenience.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Forgets the published index, the endpoint and the token, and empties the shared directory.Returns the absolutecom.codename1.io.FileSystemStoragepath of the directory whose contents both the app and the platform reader can see, creating it if needed.booleanReturns true when this port can expose the app's documents to the system file browser.voidpublishIndex(String indexJson) Atomically replaces the persisted document index and leaves it where the platform reader will find it.voidsetRemoteEndpoint(String endpoint, String authToken) Records where the platform reader should fetch content it cannot find locally.voidHints that the published index changed and the platform browser should re-enumerate.
-
Method Details
-
isDocumentProviderSupported
boolean isDocumentProviderSupported()Returns true when this port can expose the app's documents to the system file browser. -
publishIndex
Atomically replaces the persisted document index and leaves it where the platform reader will find it.
Atomically matters: the reader may wake at any moment, including midway through this call, and a half-written index is a file browser showing half a tree.
Parameters
indexJson: the serialized tree
-
setRemoteEndpoint
-
signalChange
void signalChange()Hints that the published index changed and the platform browser should re-enumerate. -
clear
void clear()Forgets the published index, the endpoint and the token, and empties the shared directory.
-