cynosurex.io
Class EnhancedFile

java.lang.Object
  extended by java.io.File
      extended by cynosurex.io.EnhancedFile
All Implemented Interfaces:
cynosurex.internal.AuthorCommon, cynosurex.internal.CommonInterface, cynosurex.internal.CompanyCommon, java.io.Serializable, java.lang.Comparable<java.io.File>

public class EnhancedFile
extends java.io.File
implements cynosurex.internal.CommonInterface

This class extends the basic File object to provide more files and directory related functionalities.

Version:
1.0, 2005-12-20
Author:
Chieh Cheng
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Fields inherited from interface cynosurex.internal.CommonInterface
copyright, copyrightYears, notice, program, version
 
Fields inherited from interface cynosurex.internal.AuthorCommon
author, copyrightSymbol, noticeMsg, rights
 
Fields inherited from interface cynosurex.internal.CompanyCommon
company, email, website
 
Constructor Summary
EnhancedFile(java.io.File parent, java.lang.String child)
           
EnhancedFile(java.lang.String pathname)
           
EnhancedFile(java.lang.String parent, java.lang.String child)
           
EnhancedFile(java.net.URI uri)
           
 
Method Summary
 java.lang.String getExtension()
           
 java.lang.String getFileNameNoExtension()
           
 java.lang.String getFriendlyFileSize()
          Returns the file size in user friendly string format.
 void removeCompletely()
          This method complete eliminate the path and its contents.
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnhancedFile

public EnhancedFile(java.io.File parent,
                    java.lang.String child)
             throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException

EnhancedFile

public EnhancedFile(java.lang.String pathname)

EnhancedFile

public EnhancedFile(java.lang.String parent,
                    java.lang.String child)

EnhancedFile

public EnhancedFile(java.net.URI uri)
Method Detail

getExtension

public java.lang.String getExtension()

getFileNameNoExtension

public java.lang.String getFileNameNoExtension()

getFriendlyFileSize

public java.lang.String getFriendlyFileSize()
Returns the file size in user friendly string format. e.g. xx GB, xx MB, xx KB, xx B.


removeCompletely

public void removeCompletely()
This method complete eliminate the path and its contents. If the path is just a file, then the file is deleted. If the path is a directory, then all its contents are deleted as well.