com.github.stephenc.javaisotools.iso9660
Class ISO9660Directory

java.lang.Object
  extended by com.github.stephenc.javaisotools.iso9660.ISO9660Directory
All Implemented Interfaces:
ISO9660HierarchyObject, Cloneable, Comparable
Direct Known Subclasses:
ISO9660RootDirectory

public class ISO9660Directory
extends Object
implements ISO9660HierarchyObject


Constructor Summary
ISO9660Directory(File file)
          Create directory
ISO9660Directory(String name)
          Create directory
 
Method Summary
 void addContentsRecursively(File file)
          Add contents of directory recursively
 ISO9660Directory addDirectory(File file)
          Add directory
 ISO9660Directory addDirectory(ISO9660Directory dir)
          Add directory
 ISO9660Directory addDirectory(String name)
          Add directory
 void addFile(File file)
          Add file
 void addFile(File file, int version)
          Add file
 void addFile(ISO9660File file)
          Add file
 void addFile(String pathname)
          Add file
 void addFile(String pathname, int version)
          Add file
 ISO9660Directory addPath(String path)
          Add path
 void addRecursively(File file)
          Add file or directory recursively
 Object clone()
           
 int compareTo(Object object)
           
 void forceSort()
          Force a sort of this directory's files and subdirectories
 List<ISO9660Directory> getDirectories()
          Returns a Vector of the directory's subdirectories
 List<ISO9660File> getFiles()
          Returns a Vector of the directory's files
 Object getID()
          Returns an Object identifying this hierarchy object
 String getISOPath()
          Returns the path from the root to this hierarchy object with each path component separated by File.separator so that its length represents the ISO 9660 path length
 int getLevel()
          Returns this directory's level of the directory hierarchy
 String getName()
          Returns the name of the hierarchy object
 ISO9660Directory getParentDirectory()
          Returns the parent directory of this hierarchy object
 ISO9660RootDirectory getRoot()
          Returns the root of the directory hierarchy
 boolean hasSubDirs()
          Returns whether this directory contains subdirectories
 boolean isDirectory()
          Returns whether the hierarchy object is a directory
 boolean isMoved()
          Returns whether this directory has been relocated
 long lastModified()
          Returns date of last modification
 ISO9660Directory relocate()
          Relocate directory
 void setName(String name)
          Set the name of the hierarchy object
 Iterator<ISO9660Directory> sortedIterator()
          Returns a directory iterator to traverse the directory hierarchy according to the needs of ISO 9660 (sort order of Path Tables and Directory Records)
 Iterator<ISO9660Directory> unsortedIterator()
          Returns a directory iterator to traverse the directory hierarchy using a recursive method
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISO9660Directory

public ISO9660Directory(String name)
Create directory

Parameters:
name - Name of the directory

ISO9660Directory

public ISO9660Directory(File file)
                 throws HandlerException
Create directory

Parameters:
file - Directory
Throws:
HandlerException - Not a directory
Method Detail

setName

public void setName(String name)
Description copied from interface: ISO9660HierarchyObject
Set the name of the hierarchy object

Specified by:
setName in interface ISO9660HierarchyObject
Parameters:
name - Name

getName

public String getName()
Description copied from interface: ISO9660HierarchyObject
Returns the name of the hierarchy object

Specified by:
getName in interface ISO9660HierarchyObject
Returns:
Name

getLevel

public int getLevel()
Returns this directory's level of the directory hierarchy

Returns:
Directory's level

getRoot

public ISO9660RootDirectory getRoot()
Description copied from interface: ISO9660HierarchyObject
Returns the root of the directory hierarchy

Specified by:
getRoot in interface ISO9660HierarchyObject
Returns:
Root

getParentDirectory

public ISO9660Directory getParentDirectory()
Description copied from interface: ISO9660HierarchyObject
Returns the parent directory of this hierarchy object

Specified by:
getParentDirectory in interface ISO9660HierarchyObject
Returns:
Parent directory

getFiles

public List<ISO9660File> getFiles()
Returns a Vector of the directory's files

Returns:
Vector containing ISO9660File objects

getDirectories

public List<ISO9660Directory> getDirectories()
Returns a Vector of the directory's subdirectories

Returns:
Vector containing ISO9660Directory objects

hasSubDirs

public boolean hasSubDirs()
Returns whether this directory contains subdirectories

Returns:
Whether the directory contains subdirectories

getISOPath

public String getISOPath()
Description copied from interface: ISO9660HierarchyObject
Returns the path from the root to this hierarchy object with each path component separated by File.separator so that its length represents the ISO 9660 path length

Specified by:
getISOPath in interface ISO9660HierarchyObject
Returns:
Path

addDirectory

public ISO9660Directory addDirectory(ISO9660Directory dir)
Add directory

Parameters:
dir - Directory to be added
Returns:
Added directory

addDirectory

public ISO9660Directory addDirectory(File file)
                              throws HandlerException
Add directory

Parameters:
file - Directory to be added
Returns:
Added directory
Throws:
HandlerException - Not a directory

addDirectory

public ISO9660Directory addDirectory(String name)
Add directory

Parameters:
name - Name of the directory to created and added
Returns:
Added directory

addPath

public ISO9660Directory addPath(String path)
                         throws HandlerException
Add path

Parameters:
path - Filesystem-specific path to be added recursively
Returns:
Topmost added directory
Throws:
HandlerException

forceSort

public void forceSort()
Force a sort of this directory's files and subdirectories


addFile

public void addFile(ISO9660File file)
Add file

Parameters:
file - File to be added

addFile

public void addFile(File file,
                    int version)
             throws HandlerException
Add file

Parameters:
file - File to be added
version - File version
Throws:
HandlerException - Problems converting to ISO9660File

addFile

public void addFile(File file)
             throws HandlerException
Add file

Parameters:
file - File to be added
Throws:
HandlerException - Problems converting to ISO9660File

addFile

public void addFile(String pathname,
                    int version)
             throws HandlerException
Add file

Parameters:
pathname - File to be added
version - File version
Throws:
HandlerException - Problems converting to ISO9660File

addFile

public void addFile(String pathname)
             throws HandlerException
Add file

Parameters:
pathname - File to be added
Throws:
HandlerException - Problems converting to ISO9660File

addRecursively

public void addRecursively(File file)
                    throws HandlerException
Add file or directory recursively

Parameters:
file - File or directory to be added recursively
Throws:
HandlerException - Problems converting to ISO9660File

addContentsRecursively

public void addContentsRecursively(File file)
                            throws HandlerException
Add contents of directory recursively

Parameters:
file - Directory the contents of which are to be added recursively
Throws:
HandlerException - Problems converting to ISO9660File

compareTo

public int compareTo(Object object)
              throws ClassCastException,
                     NullPointerException
Specified by:
compareTo in interface Comparable
Throws:
ClassCastException
NullPointerException

lastModified

public long lastModified()
Returns date of last modification

Returns:
Date of last modification

isDirectory

public boolean isDirectory()
Description copied from interface: ISO9660HierarchyObject
Returns whether the hierarchy object is a directory

Specified by:
isDirectory in interface ISO9660HierarchyObject
Returns:
Whether this is a directory

isMoved

public boolean isMoved()
Returns whether this directory has been relocated

Returns:
Whether this is a relocated directory

relocate

public ISO9660Directory relocate()
Relocate directory

Returns:
Old parent directory

getID

public Object getID()
Description copied from interface: ISO9660HierarchyObject
Returns an Object identifying this hierarchy object

Specified by:
getID in interface ISO9660HierarchyObject
Returns:
Identifying Object

clone

public Object clone()
Overrides:
clone in class Object

sortedIterator

public Iterator<ISO9660Directory> sortedIterator()
Returns a directory iterator to traverse the directory hierarchy according to the needs of ISO 9660 (sort order of Path Tables and Directory Records)

Returns:
Iterator

unsortedIterator

public Iterator<ISO9660Directory> unsortedIterator()
Returns a directory iterator to traverse the directory hierarchy using a recursive method

Returns:
Iterator


Copyright © 2013. All Rights Reserved.