org.apache.commons.vfs2.util
Class FileObjectUtils

java.lang.Object
  extended by org.apache.commons.vfs2.util.FileObjectUtils

public final class FileObjectUtils
extends Object

Stuff to get some strange things from an FileObject.

Author:
Commons VFS team

Method Summary
static AbstractFileObject getAbstractFileObject(FileObject fileObject)
          Get access to the base object even if decorated.
static boolean isInstanceOf(FileObject fileObject, Class<?> wantedClass)
          Check if the given FileObject is instance of given class argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAbstractFileObject

public static AbstractFileObject getAbstractFileObject(FileObject fileObject)
                                                throws FileSystemException
Get access to the base object even if decorated.

Parameters:
fileObject - The FileObject.
Returns:
The decorated FileObject or null.
Throws:
FileSystemException - if an error occurs.

isInstanceOf

public static boolean isInstanceOf(FileObject fileObject,
                                   Class<?> wantedClass)
                            throws FileSystemException
Check if the given FileObject is instance of given class argument.

Parameters:
fileObject - The FileObject.
wantedClass - The Class to check.
Returns:
true if fileObject is an instance of the specified Class.
Throws:
FileSystemException - if an error occurs.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.