Example usage for org.apache.commons.vfs FileObject isAttached

List of usage examples for org.apache.commons.vfs FileObject isAttached

Introduction

In this page you can find the example usage for org.apache.commons.vfs FileObject isAttached.

Prototype

public boolean isAttached();

Source Link

Document

check if the fileObject is attaced

Usage

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

private static void assertFolder(FileObject folder) throws Exception {
    assertTrue(folder.exists());/*from w  ww. j a v a2s. c  om*/
    assertTrue(folder.isAttached()); // exists() causes attach
    assertTrue(folder.isReadable());
    assertTrue(folder.isWriteable());
    assertFalse(folder.isHidden());
    assertTrue(folder.getType().hasChildren());
    assertFalse(folder.getType().hasContent());

    // TODO: with combined local option, local children of GAE folder will
    // have a different parent; maybe we can compare paths when GaeFileName
    // is modified to store abspath like LocalFileName
    //      FileObject[] children = folder.getChildren();
    //      for ( FileObject child : children ) {
    //         assertEquals( folder, child.getParent() );
    //         FileObject childObject = folder.getChild( child.getName().getURI() );
    //         assertEquals( child, childObject );
    //         assertEquals( folder, childObject.getParent() );
    //      }

    // TODO: use folder.findFiles( Selectors.SELECT_ALL) to get all
    // descendants, then test FileName.isDescendant() and isAncestor()
}