Get list of database files

#1

Hi,
we would like to know if there is any API we can use to get a list of all database files on an ObjectDB server.
The ObjectDB explorer has such a feature (File->Open C/S Connection->Browse...).

Thanks for help!

#2

There is an undocumented method, which is indeed in use by the Explorer:

import java.io.File;

import com.objectdb.Utilities;

    ...

    File root = Utilities.getServerFileSystem(
                    host, port, username, password, false);

This will return the root directory, which then can be explored further using the java.io.File API.

You can also get the File (or directory) of a specific path on the server using:

    File root = Utilities.getServerFileSystem(
                    host, port, username, password, path, false);

 

ObjectDB Support
#3

Hi,
thanks for your quick reply. It works great!

Reply