Search in sources :

Example 1 with FileType

use of org.objectweb.proactive.extensions.dataspaces.api.FileType in project scheduling by ow2-proactive.

the class TaskProActiveDataspaces method createFolderHierarchy.

protected void createFolderHierarchy(boolean isDebugEnabled, DataSpacesFileObject fileObject, DataSpacesFileObject target) throws FileSystemException {
    FileType fileObjectType = fileObject.getType();
    if (FileType.FOLDER.equals(fileObjectType)) {
        if (isDebugEnabled) {
            logger.debug("Creating folder " + target.getRealURI());
        }
        if (!target.exists()) {
            target.createFolder();
            setFolderRightsForRunAsUserMode(target);
        }
    } else if (FileType.FILE.equals(fileObjectType)) {
        DataSpacesFileObject parent = target.getParent();
        if (isDebugEnabled) {
            logger.debug("Creating folder " + parent.getRealURI());
        }
        if (!parent.exists()) {
            parent.createFolder();
            setFolderRightsForRunAsUserMode(parent);
        }
    }
}
Also used : FileType(org.objectweb.proactive.extensions.dataspaces.api.FileType) DataSpacesFileObject(org.objectweb.proactive.extensions.dataspaces.api.DataSpacesFileObject)

Aggregations

DataSpacesFileObject (org.objectweb.proactive.extensions.dataspaces.api.DataSpacesFileObject)1 FileType (org.objectweb.proactive.extensions.dataspaces.api.FileType)1