javax.rad.io
Class DirectoryHandle

java.lang.Object
  extended by javax.rad.io.DirectoryHandle
All Implemented Interfaces:
IFileHandle

public class DirectoryHandle
extends java.lang.Object
implements IFileHandle

The DirectorHandle is an IFileHandle representation for directories. It does not allow file access. It is only an informative class.


Constructor Summary
DirectoryHandle(java.io.File pDirectory)
          Creates a new instance of DirectoryHandle and checks if the directory exists.
DirectoryHandle(java.lang.String pDirectory)
          Creates a new instance of DirectoryHandle without checks.
 
Method Summary
 java.lang.String getFileName()
          Gets the file name of this file handle.
 java.io.InputStream getInputStream()
          Gets the InputStream of this file handle.
 long getLength()
          Gets the length of the InputStream in bytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryHandle

public DirectoryHandle(java.lang.String pDirectory)
Creates a new instance of DirectoryHandle without checks.

Parameters:
pDirectory - the absolute directory path. If the path does not exist, it doesn't matter

DirectoryHandle

public DirectoryHandle(java.io.File pDirectory)
Creates a new instance of DirectoryHandle and checks if the directory exists.

Parameters:
pDirectory - the directory
Throws:
java.lang.IllegalArgumentException - if directory does not exist
Method Detail

getFileName

public java.lang.String getFileName()
Gets the file name of this file handle.

Specified by:
getFileName in interface IFileHandle
Returns:
the file name of this file handle.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets the InputStream of this file handle.

Specified by:
getInputStream in interface IFileHandle
Returns:
the InputStream of this file handle.
Throws:
java.io.IOException - if an exception occurs.

getLength

public long getLength()
               throws java.io.IOException
Gets the length of the InputStream in bytes. -1 is returned if getInputStream is null.

Specified by:
getLength in interface IFileHandle
Returns:
the length of the InputStream in bytes.
Throws:
java.io.IOException - if an exception occurs.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.