Example usage for org.apache.commons.vfs Selectors SELECT_SELF_AND_CHILDREN

List of usage examples for org.apache.commons.vfs Selectors SELECT_SELF_AND_CHILDREN

Introduction

In this page you can find the example usage for org.apache.commons.vfs Selectors SELECT_SELF_AND_CHILDREN.

Prototype

FileSelector SELECT_SELF_AND_CHILDREN

To view the source code for org.apache.commons.vfs Selectors SELECT_SELF_AND_CHILDREN.

Click Source Link

Document

A FileSelector that selects the base file/folder and its direct children.

Usage

From source file:egovframework.rte.fdl.filehandling.EgovFileUtil.java

/**
 * <p>//  ww w .j a v a 2  s .  c o m
 *  ? ? ?  .
 * </p>
 * @param cmd
 *        <code>String</code>
 * @return  
 * @throws FileSystemException
 */
public static int rm(final String cmd) throws FileSystemException {
    int result = -1;

    try {
        final FileObject file = manager.resolveFile(basefile, cmd);

        result = file.delete(Selectors.SELECT_SELF_AND_CHILDREN);

        log.debug("result is " + result);

    } catch (FileSystemException e) {
        log.error(e.toString());
        throw new FileSystemException(e);
    }

    return result;
}

From source file:com.newatlanta.appengine.junit.vfs.gae.GaeFolderTestCase.java

private void testFindFiles(FileObject rootObject) throws Exception {
    FileObject[] findFiles = rootObject.findFiles(Selectors.EXCLUDE_SELF);
    findFiles = rootObject.findFiles(Selectors.SELECT_ALL);
    findFiles = rootObject.findFiles(Selectors.SELECT_CHILDREN);
    findFiles = rootObject.findFiles(Selectors.SELECT_FILES);
    findFiles = rootObject.findFiles(Selectors.SELECT_FOLDERS);
    findFiles = rootObject.findFiles(Selectors.SELECT_SELF);
    findFiles = rootObject.findFiles(Selectors.SELECT_SELF_AND_CHILDREN);
}

From source file:org.objectweb.proactive.extensions.dataspaces.vfs.adapter.VFSFileObjectAdapter.java

/**
 * @param selector/*from  w  w w.  ja va  2s.c  om*/
 *            may be null
 */
private static org.apache.commons.vfs.FileSelector buildFVSSelector(FileSelector selector) {
    switch (selector) {
    case EXCLUDE_SELF:
        return Selectors.EXCLUDE_SELF;
    case SELECT_ALL:
        return Selectors.SELECT_ALL;
    case SELECT_FILES:
        return Selectors.SELECT_FILES;
    case SELECT_FOLDERS:
        return Selectors.SELECT_FOLDERS;
    case SELECT_CHILDREN:
        return Selectors.SELECT_CHILDREN;
    case SELECT_SELF:
        return Selectors.SELECT_SELF;
    case SELECT_SELF_AND_CHILDREN:
        return Selectors.SELECT_SELF_AND_CHILDREN;
    default:
        return null;
    }
}