com.github.stephenc.javaisotools.iso9660
Class ISO9660File

java.lang.Object
  extended by com.github.stephenc.javaisotools.iso9660.ISO9660File
All Implemented Interfaces:
ISO9660HierarchyObject, Cloneable, Comparable

public class ISO9660File
extends Object
implements ISO9660HierarchyObject

Note: this class has a natural ordering that is inconsistent with equals.


Field Summary
static Pattern FILEPATTERN
           
 
Constructor Summary
ISO9660File(DataReference dataReference, String name, long lastModified)
           
ISO9660File(File file)
          Create File
ISO9660File(File file, int version)
          Create file from File object
ISO9660File(ISO9660File file)
           
ISO9660File(String pathname)
          Create File
ISO9660File(String pathname, int version)
          Create file from File object
 
Method Summary
 Object clone()
           
 int compareTo(Object object)
           
 void enforce8plus3(boolean force)
          Force short filename ("8+3")
 void enforceDotDelimiter(boolean force)
          Force dot character
 boolean enforces8plus3()
          Returns whether this file's name is forced to be recorded "8+3"
 boolean enforcesDotDelimiter()
          Returns whether this file's name is forced to include the dot character
 boolean equals(Object toCompare)
           
 String getAbsolutePath()
          Return the File.getAbsolutePath() for the underlying File or null if this ISO9660File is not constructed from a File
 Object getContentID()
          Returns and identification of the File underlying this object
 DataReference getDataReference()
           
 String getExtension()
          Returns the extension of the file (without front dot)
 String getFilename()
          Returns the name of the file (without dot)
 String getFullName()
          Returns the full ISO 9660 filename, i.e.
 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
 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
 int getVersion()
          Returns the file version
 int hashCode()
           
 boolean isDirectory()
          Returns whether the hierarchy object is a directory
 boolean isMovedDirectory()
          Returns whether this represents a moved directory "totem pole"
 long lastModified()
           
 long length()
           
 void setExtension(String extension)
          Set the extension of the file (without front dot)
 void setFilename(String filename)
          Set the name of the file (without dot)
 void setIsMovedDirectory()
          Declare this file to be a moved directory "totem pole"
 void setName(String name)
          Set the name of the hierarchy object
 void setVersion(int version)
          Set file version
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILEPATTERN

public static final Pattern FILEPATTERN
Constructor Detail

ISO9660File

public ISO9660File(DataReference dataReference,
                   String name,
                   long lastModified)
            throws HandlerException
Throws:
HandlerException

ISO9660File

public ISO9660File(File file,
                   int version)
            throws HandlerException
Create file from File object

Parameters:
file - File
version - File version
Throws:
HandlerException - Invalid File version or file is a directory

ISO9660File

public ISO9660File(String pathname,
                   int version)
            throws HandlerException
Create file from File object

Parameters:
pathname - File
version - File version
Throws:
HandlerException - Invalid File version or file is a directory

ISO9660File

public ISO9660File(File file)
            throws HandlerException
Create File

Parameters:
file - File
Throws:
HandlerException - File is a directory

ISO9660File

public ISO9660File(String pathname)
            throws HandlerException
Create File

Parameters:
pathname - File
Throws:
HandlerException - File is a directory

ISO9660File

public ISO9660File(ISO9660File file)
            throws HandlerException
Throws:
HandlerException
Method Detail

getFilename

public String getFilename()
Returns the name of the file (without dot)

Returns:
File name

getExtension

public String getExtension()
Returns the extension of the file (without front dot)

Returns:
File extension

getName

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

Specified by:
getName in interface ISO9660HierarchyObject
Returns:
Name

setIsMovedDirectory

public void setIsMovedDirectory()
Declare this file to be a moved directory "totem pole"


isMovedDirectory

public boolean isMovedDirectory()
Returns whether this represents a moved directory "totem pole"

Returns:
Whether this is a moved directory

setFilename

public void setFilename(String filename)
Set the name of the file (without dot)

Parameters:
filename - File name

setExtension

public void setExtension(String extension)
Set the extension of the file (without front dot)

Parameters:
extension - File extension

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

getFullName

public String getFullName()
Returns the full ISO 9660 filename, i.e. with file version

Returns:
Full ISO 9660 file name

getVersion

public int getVersion()
Returns the file version

Returns:
File version

setVersion

public void setVersion(int version)
                throws HandlerException
Set file version

Parameters:
version - File version
Throws:
HandlerException - Invalid file version

enforces8plus3

public boolean enforces8plus3()
Returns whether this file's name is forced to be recorded "8+3"

Returns:
Whether this file name will be short

enforce8plus3

public void enforce8plus3(boolean force)
Force short filename ("8+3")

Parameters:
force - Whether to force this file's name to be short

enforcesDotDelimiter

public boolean enforcesDotDelimiter()
Returns whether this file's name is forced to include the dot character

Returns:
Whether the dot character is enforced

enforceDotDelimiter

public void enforceDotDelimiter(boolean force)
Force dot character

Parameters:
force - Whether to force this file's name to include the dot character

compareTo

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

equals

public boolean equals(Object toCompare)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

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

getISOPath

public String getISOPath()
                  throws NullPointerException
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
Throws:
NullPointerException

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

getContentID

public Object getContentID()
Returns and identification of the File underlying this object

Returns:
Content identification Object

getRoot

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

Specified by:
getRoot in interface ISO9660HierarchyObject
Returns:
Root
Throws:
NullPointerException

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

clone

public Object clone()
Overrides:
clone in class Object

length

public long length()

lastModified

public long lastModified()

getAbsolutePath

public String getAbsolutePath()
Return the File.getAbsolutePath() for the underlying File or null if this ISO9660File is not constructed from a File

Returns:

getDataReference

public DataReference getDataReference()


Copyright © 2013. All Rights Reserved.