All Downloads are FREE. Search and download functionalities are using the official Maven repository.

syncloud.filesystem.FSStorage Maven / Gradle / Ivy

The newest version!
package syncloud.filesystem;

import syncloud.storage.*;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class FSStorage implements IStorage {

    private StorageKey key;

    public FSStorage(StorageKey key) {
        this.key = key;
    }

    @Override
    public StorageKey getKey() {
        return key;
    }

    @Override
    public List getRoots() {
        File[] roots = File.listRoots();
        List rootsList = new ArrayList();
        for(File root: roots) {
            if (root.exists())
                rootsList.add(new FSFolder(NodeKey.create(key, root.getAbsolutePath())));
        }
        return rootsList;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy