How to fire up a File Service Subsystem with RSE for Eclipse

IHost uppmaxHost = (new UppmaxManager()).getUppmaxHost();
 
ISystemRegistry sysReg = RSECorePlugin.getTheSystemRegistry();
ISubSystem[] subSystems = sysReg.getSubsystems(uppmaxHost, IFileServiceSubSystem.class);
 
if (subSystems.length == 0 || !(subSystems[0] instanceof FileServiceSubSystem)) {
    System.out.println("Warning ...");
    return;
}
 
FileServiceSubSystem fsss = (FileServiceSubSystem) subSystems[0];
try {
    IRemoteFile[] rootRemoteFolders = fsss.listRoots(null);
    for (IRemoteFile folder : rootRemoteFolders) {
        System.out.println("Remote root folder: " + folder.getAbsolutePath());
    }
} catch (InterruptedException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}

Tags: