|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectigpp.util.File
public class File
File utilities that augment the standard java.io.File class.
Constructor Summary | |
---|---|
File()
|
Method Summary | |
---|---|
static long |
copy(String source,
String destination)
Copy a file from one location to another. |
static boolean |
delete(String source)
Remove a file from the file system |
static boolean |
exists(String pathname)
Deterines if a file exists. |
static String |
getBaseName(String pathname)
Extract the base name of the file from a pathname. |
static String |
getExtension(String pathname)
Extract the extension of the file from a pathname. |
static String |
getMD5(String pathname)
Return the MD5 digest for a file. |
static String |
getModificationDate(String pathname)
Return the modification date in ISO8601 format for a file. |
static String |
getName(String pathname)
Extract the name of the file from a pathname. |
static String |
getParent(String pathname)
Extract the parent of the file from a pathname. |
static String |
getSHA1(String pathname)
Return the SHA-1 digest for a file. |
static String |
getSHA256(String pathname)
Return the SHA-256 digest for a file. |
static String |
getSHA512(String pathname)
Return the SHA-512 digest for a file. |
static long |
getSize(String pathname)
Return the size of the file in bytes. |
static boolean |
isDirectory(String pathname)
Determines if a given pathname is to a directory. |
static boolean |
isFile(String pathname)
Determines if a given pathname is to a file. |
static boolean |
mkdirs(String pathname)
Create all directories leading to a file with a given pathname. |
static boolean |
rename(String source,
String destination)
Rename a file. |
static boolean |
setOwner(String pathname,
String user,
String group)
Set the owner and group for a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public File()
Method Detail |
---|
public static long copy(String source, String destination) throws NullPointerException, IOException, SecurityException
source
- the name of the source file.destination
- the name of the file to copy the source file to.
NullPointerException
IOException
SecurityException
public static boolean delete(String source)
source
- the name of the source file.
true
if the delete is successful.
false
otherwise.public static boolean rename(String source, String destination) throws NullPointerException, SecurityException, IOException
source
- the name of the source file.
true
if the rename is successful.
false
otherwise.
IOException
- If an I/O error occurs, which is possible because
the construction of the canonical pathname may require file system queries
NullPointerException
- If the either pathname argument is null
SecurityException
- If a security manager exists and its
SecurityManager.checkWrite(java.lang.String) method denies
write access to either the old or new pathnamespublic static boolean mkdirs(String pathname)
pathname
- the path and filename for a file.
public static boolean isDirectory(String pathname)
pathname
- the name of the file system object.
true
if the pathname points to a directory.
false
otherwise.public static boolean isFile(String pathname)
pathname
- the name of the filesystem object.
true
if the pathname points to a directory.
false
otherwise.public static String getName(String pathname)
pathname
- the name of the file system object.
public static String getParent(String pathname)
pathname
- the name of the filesystem object.
public static String getBaseName(String pathname)
pathname
- the name of the file system object.
public static String getExtension(String pathname)
pathname
- the name of the file system object.
public static boolean setOwner(String pathname, String user, String group)
pathname
- the name of the file system object.user
- the user name in the system.group
- the group name in the system
public static long getSize(String pathname)
pathname
- the name of the file system object.
public static boolean exists(String pathname)
pathname
- the name of the file system object.
public static String getModificationDate(String pathname)
pathname
- the name of the file system object.
public static String getMD5(String pathname)
pathname
- the name of the filesystem object.
public static String getSHA1(String pathname)
pathname
- the name of the filesystem object.
public static String getSHA256(String pathname)
pathname
- the name of the filesystem object.
public static String getSHA512(String pathname)
pathname
- the name of the filesystem object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |