Java API support on desktop platforms

Thanks @lionel.faber it is indeed helpful. I’ve always known that it was feasible to have subcontainers but have never seen it suggested in documentation, discussion or indeed in code before (though that might well exist). Can you point to an RFC or documentation for this that maybe I’ve missed, or say whether it is specified in some private design doc? I’m curious why it had been so hard to discover! :slight_smile:

I hadn’t thought of using it as a way to implement an empty folder, but I can see that this is in effect what we get on first creating a Web service - I.e. we get an entry in _public that points to an empty NFS container.

Things like this could do with being documented along with design guidance, as it is figuring out how to do things like this properly that takes devs a lot of time, and can lead to incompatible implementations.

Thanks very much for your help. I’m inclined not to act on it until it is clear in the API docs, and I’m sure things aren’t likely to change (eg in view of work in API Appendable Data and RDF).

7 Likes

Exactly!
Although the WHM, browser etc. uses this structure to store sub-folders I’m afraid that there is no documentation for the current implementation. We are in the early stages of a documentation roadmap. We’ll be adding this information (and much more :smiley: ) to project wikis.

5 Likes

A heads-up on a few updates made to the safe_app_java project:

  • The Android SDK is no longer downloaded by default. So building the libs only for desktop is less of a pain.
  • The safe-app module now uses the gradle-java-flavours module to specify mock and non-mock flavours for the desktop build too! Thank you again @ogrebgr!
  • The safe-authenticator module has been removed and the Authenticator class has moved to the mock flavour of the desktop project.
  • The project now builds only 2 jars (mock and nonMock) that contain the native libs on all platforms. This comes with a cost of a larger jar size, but it seems to be the standard.

The OP with the build instructions and the examples have been updated :slight_smile:

7 Likes

I’ve been looking at the webFetch() code in safe_app_nodejs and do not believe it allows subcontainers within an NFS container, which is what I thought you were implying above. See:

The above code has an NFS container (emulation) and it tries to find the file in this container. There is no code to handle the case where a path matches a subcontainer.

So while you might be able to represent an empty directory with an entry containing another NFS (sub)container, you can’t use the latter to hold files - which is what I took to be your meaning. It seems daft to use an empty subcontainer to hold an empty directory unless you can also use it to hold files, because you might just as well represent the empty folder with a ‘null’ value.

I don’t know if NFS is going to be supported in future APIs, so I’m not sure it is worth digging further into this now. And I’m glad I didn’t try implementing subcontainers in SAFE Drive and SafenetworkJs!

1 Like