|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.foundation.ERXFileUtilities
public class ERXFileUtilities
Collection of handy {java.io.File} utilities.
Field Summary | |
---|---|
static org.apache.log4j.Logger |
log
logging support |
Constructor Summary | |
---|---|
ERXFileUtilities()
|
Method Summary | |
---|---|
static com.webobjects.foundation.NSArray<java.io.File> |
arrayByAddingFilesInDirectory(java.io.File directory,
boolean recursive)
Creates a new NSArray which contains all files in the specified directory. |
static byte[] |
bytesFromFile(java.io.File f)
Returns the byte array for a given file. |
static byte[] |
bytesFromFile(java.io.File f,
int n)
Returns an array of the first n bytes for a given file. |
static byte[] |
bytesFromGZippedFile(java.io.File f)
Returns the byte array for a given gzipped file. |
static byte[] |
bytesFromInputStream(java.io.InputStream in)
Returns the byte array for a given stream. |
static byte[] |
bytesFromInputStream(java.io.InputStream fis,
int n)
Returns an array of the first n bytes for a given input stream |
static void |
chmod(java.io.File file,
java.lang.String mode)
Java wrapper for call out to chmod. |
static void |
chmodRecursively(java.io.File dir,
java.lang.String mode)
Java wrapper for call out to chmod with -R parameter for recursive processing. |
static void |
copyFilesFromDirectory(java.io.File srcDirectory,
java.io.File dstDirectory,
boolean deleteOriginals,
boolean replaceExistingFiles,
boolean recursiveCopy,
java.io.FileFilter filter)
Copies all of the files in a given directory to another directory. |
static void |
copyFilesFromDirectory(java.io.File srcDirectory,
java.io.File dstDirectory,
boolean deleteOriginals,
boolean recursiveCopy,
java.io.FileFilter filter)
Copies all of the files in a given directory to another directory. |
static void |
copyFileToFile(java.io.File srcFile,
java.io.File dstFile,
boolean deleteOriginals,
boolean forceDelete)
Copys the source file to the destination |
static java.io.File |
createTempDir()
Creates a temporary directory. |
static java.io.File |
createTempDir(java.lang.String prefix,
java.lang.String suffix)
Creates a temporary directory. |
static java.lang.String |
datePathWithRoot(java.lang.String rootPath)
Returns a path containing an optional root with a directory hierarchy based on the current time |
static boolean |
deleteDirectory(java.io.File directory)
Deletes a given directory in a recursive fashion. |
static boolean |
deleteFile(java.io.File fileToDelete)
|
static boolean |
deleteFiles(com.webobjects.foundation.NSMutableArray filesToDelete)
Deletes all files in filesToDelete uses the methdo deleteDirectory |
static void |
deleteFilesInDirectory(java.io.File directory,
boolean recurseIntoDirectories)
Deletes all of the files in a given directory with the option to recursively delete all of the directories in the given directory. |
static void |
deleteFilesInDirectory(java.io.File directory,
java.io.FileFilter filter,
boolean recurseIntoDirectories,
boolean removeDirectories)
Deletes all of the files in a given directory with the option to recursively delete all of the files in the given directory. |
static java.lang.String |
fileExtension(java.lang.String name)
returns the fileExtension from the specified filename |
static java.lang.String |
fileNameFromBrowserSubmittedPath(java.lang.String path)
Returns the file name portion of a browser submitted path. |
static java.io.InputStream |
inputStreamForResourceNamed(java.lang.String fileName,
java.lang.String frameworkName,
com.webobjects.foundation.NSArray languages)
Get the input stream from the specified Resource. |
static long |
lastModifiedDateForFileInFramework(java.lang.String fileName,
java.lang.String frameworkName)
Determines the last modification date for a given file in a framework. |
static long |
length(java.io.File f)
|
static void |
linkFiles(java.io.File source,
java.io.File destination,
boolean symbolic,
boolean allowUnlink,
boolean followSymbolicLinks)
Creates a symlink for a given file. |
static java.io.File[] |
listDirectories(java.io.File baseDir,
boolean recursive)
Lists all directories in the specified directory, is desired recursive. |
static java.io.File[] |
listFiles(java.io.File baseDir,
boolean recursive,
java.io.FileFilter filter)
Lists all files in the specified directory, if desired recursively. |
static byte[] |
md5(java.io.File file)
Generate an MD5 hash from a file. |
static byte[] |
md5(java.io.InputStream in)
Generate an MD5 hash from an input stream. |
static java.lang.String |
md5Hex(java.io.File file)
Generate an MD5 hash from a file. |
static java.lang.String |
md5Hex(java.io.InputStream in)
Generate an MD5 hash from an input stream. |
static java.lang.String |
pathForResourceNamed(java.lang.String fileName,
java.lang.String frameworkName,
com.webobjects.foundation.NSArray languages)
Determines the path of the specified Resource. |
static java.net.URL |
pathURLForResourceNamed(java.lang.String fileName,
java.lang.String frameworkName,
com.webobjects.foundation.NSArray languages)
Determines the path URL of the specified Resource. |
static java.lang.Object |
readPropertyListFromFileInFramework(java.lang.String fileName,
java.lang.String aFrameWorkName)
Reads a file in from the file system and then parses it as if it were a property list, using the platform's default encoding. |
static java.lang.Object |
readPropertyListFromFileInFramework(java.lang.String fileName,
java.lang.String aFrameWorkName,
com.webobjects.foundation.NSArray languageList)
Reads a file in from the file system for the given set of languages and then parses the file as if it were a property list, using the platform's default encoding. |
static java.lang.Object |
readPropertyListFromFileInFramework(java.lang.String fileName,
java.lang.String aFrameWorkName,
com.webobjects.foundation.NSArray languageList,
java.lang.String encoding)
Reads a file in from the file system for the given set of languages and then parses the file as if it were a property list, using the specified encoding. |
static java.lang.Object |
readPropertyListFromFileInFramework(java.lang.String fileName,
java.lang.String aFrameWorkName,
java.lang.String encoding)
Reads a file in from the file system and then parses it as if it were a property list, using the specified encoding. |
static void |
remoteCopyFile(java.io.File srcFile,
java.lang.String dstHost,
java.lang.String dstPath)
Copy a file across hosts using scp. |
static void |
remoteCopyFile(java.lang.String srcHost,
java.lang.String srcPath,
java.io.File dstFile)
Copy a file across hosts using scp. |
static void |
remoteCopyFile(java.lang.String srcHost,
java.lang.String srcPath,
java.lang.String dstHost,
java.lang.String dstPath)
Copy a file across hosts using scp. |
static java.lang.String |
removeFileExtension(java.lang.String name)
returns the filename without its fileExtension |
static void |
renameTo(java.io.File source,
java.io.File destination)
moves a file from one location to another one. |
static java.lang.String |
replaceFileExtension(java.lang.String path,
java.lang.String newExtension)
Replaces the extension of the given file with the new extension. |
static java.io.File |
reserveUniqueFile(java.io.File desiredFile,
boolean overwrite)
Reserves a unique file on the filesystem based on the given file name. |
static boolean |
resourceExists(java.lang.String fileName,
java.lang.String frameworkName,
com.webobjects.foundation.NSArray languages)
Determines if a given resource exists. |
static java.lang.String |
shortenFilename(java.lang.String name,
int maxLength)
shortens a filename, for example aVeryLongFileName.java -> aVer...Name.java |
static java.lang.String |
stringFromFile(java.io.File f)
Returns a string from the file using the default encoding. |
static java.lang.String |
stringFromFile(java.io.File f,
java.lang.String encoding)
Returns a string from the file using the specified encoding. |
static java.lang.String |
stringFromGZippedFile(java.io.File f)
Returns a string from the gzipped file using the default encoding. |
static java.lang.String |
stringFromInputStream(java.io.InputStream in)
Returns a string from the input stream using the default encoding. |
static java.lang.String |
stringFromInputStream(java.io.InputStream in,
java.lang.String encoding)
Returns a string from the input stream using the specified encoding. |
static java.lang.String |
stringFromURL(java.net.URL url)
Returns the String from the contents of the given URL. |
static void |
stringToFile(java.lang.String s,
java.io.File f)
Writes the contents of s to f
using the platform's default encoding. |
static void |
stringToFile(java.lang.String s,
java.io.File f,
java.lang.String encoding)
Writes the contents of s to f
using specified encoding. |
static void |
stringToGZippedFile(java.lang.String s,
java.io.File f)
|
static java.io.File |
unzipFile(java.io.File f,
java.io.File destination)
Decompresses the specified zipfile. |
static java.net.URL |
URLFromFile(java.io.File file)
Create an URL for a given file. |
static java.net.URL |
URLFromPath(java.lang.String fileName)
Create an URL for a given path. |
static void |
writeInputStreamToFile(java.io.File f,
java.io.InputStream is)
Deprecated. use writeInputStreamToFile(InputStream is, File f) instead |
static void |
writeInputStreamToFile(java.io.InputStream stream,
java.io.File file)
Writes the contents of an InputStream to a specified file. |
static void |
writeInputStreamToGZippedFile(java.io.InputStream stream,
java.io.File file)
|
static void |
writeInputStreamToOutputStream(java.io.InputStream in,
boolean closeInputStream,
java.io.OutputStream out,
boolean closeOutputStream)
Copies the contents of the input stream to the given output stream. |
static void |
writeInputStreamToOutputStream(java.io.InputStream in,
java.io.OutputStream out)
Copies the contents of the input stream to the given output stream. |
static java.io.File |
writeInputStreamToTempFile(java.io.InputStream stream)
Writes the contents of an InputStream to a temporary file. |
static java.io.File |
writeInputStreamToTempFile(java.io.InputStream stream,
java.lang.String prefix,
java.lang.String suffix)
Writes the contents of an InputStream to a temporary file. |
static void |
writeUrlToTempFile(java.lang.String url,
java.io.File file)
Copies the contents of the given URL to a file. |
static java.io.File |
writeUrlToTempFile(java.lang.String url,
java.lang.String prefix,
java.lang.String suffix)
Copies the contents of the given URL to a temporary file. |
static void |
writeUrlToTempFile(java.net.URL url,
java.io.File file)
Copies the contents of the given URL to a file. |
static java.io.File |
writeUrlToTempFile(java.net.URL url,
java.lang.String prefix,
java.lang.String suffix)
Copies the contents of the given URL to a temporary file. |
static java.io.File |
zipFile(java.io.File f,
boolean absolutePaths,
boolean deleteOriginal,
boolean forceDelete)
zips a given File. |
static java.io.File |
zipFile(java.io.File f,
boolean absolutePaths,
boolean deleteOriginal,
boolean forceDelete,
int level)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger log
Constructor Detail |
---|
public ERXFileUtilities()
Method Detail |
---|
public static java.io.File writeUrlToTempFile(java.lang.String url, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
url
- the URL to copy fromprefix
- the temporary file prefixsuffix
- the temporary file suffix (if null, the extension from the URL is used)
java.io.IOException
- if the copy failspublic static java.io.File writeUrlToTempFile(java.net.URL url, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
url
- the URL to copy fromprefix
- the temporary file prefixsuffix
- the temporary file suffix (if null, the extension from the URL is used)
java.io.IOException
- if the copy failspublic static void writeUrlToTempFile(java.lang.String url, java.io.File file) throws java.io.IOException
url
- the URL to copy fromfile
- the File to write to
java.io.IOException
- if the copy failspublic static void writeUrlToTempFile(java.net.URL url, java.io.File file) throws java.io.IOException
url
- the URL to copy fromfile
- the File to write to
java.io.IOException
- if the copy failspublic static byte[] bytesFromInputStream(java.io.InputStream in) throws java.io.IOException
in
- stream to get the bytes from
java.io.IOException
- if things go wrongpublic static java.lang.String stringFromInputStream(java.io.InputStream in, java.lang.String encoding) throws java.io.IOException
in
- stream to readencoding
- to be used, null will use the default
java.io.IOException
public static java.lang.String stringFromInputStream(java.io.InputStream in) throws java.io.IOException
in
- stream to read
java.io.IOException
public static java.lang.String stringFromURL(java.net.URL url) throws java.io.IOException
url
- the URL to read from
java.io.IOException
- if an error occurspublic static byte[] bytesFromGZippedFile(java.io.File f) throws java.io.IOException
f
- file to get the bytes from
java.io.IOException
- if things go wrongpublic static byte[] bytesFromFile(java.io.File f) throws java.io.IOException
f
- file to get the bytes from
java.io.IOException
- if things go wrongpublic static byte[] bytesFromFile(java.io.File f, int n) throws java.io.IOException
f
- file to get the bytes fromn
- number of bytes to read from input file
java.io.IOException
- if things go wrongpublic static byte[] bytesFromInputStream(java.io.InputStream fis, int n) throws java.io.IOException
fis
- inputstream to get the bytes fromn
- number of bytes to read from input stream
java.io.IOException
- if things go wrongpublic static void writeInputStreamToFile(java.io.File f, java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static java.io.File writeInputStreamToTempFile(java.io.InputStream stream) throws java.io.IOException
stream
- to pull data from
java.io.IOException
public static java.io.File writeInputStreamToTempFile(java.io.InputStream stream, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
stream
- to pull data fromprefix
- the filename prefix of the temp filesuffix
- the filename suffix of the temp file
java.io.IOException
public static void writeInputStreamToFile(java.io.InputStream stream, java.io.File file) throws java.io.IOException
file
- to write tostream
- to pull data from
java.io.IOException
public static void writeInputStreamToGZippedFile(java.io.InputStream stream, java.io.File file) throws java.io.IOException
java.io.IOException
public static void writeInputStreamToOutputStream(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
in
- the input stream to copy fromout
- the output stream to copy to
java.io.IOException
- if there is any failurepublic static void writeInputStreamToOutputStream(java.io.InputStream in, boolean closeInputStream, java.io.OutputStream out, boolean closeOutputStream) throws java.io.IOException
in
- the input stream to copy fromcloseInputStream
- if true, the input stream will be closedout
- the output stream to copy tocloseOutputStream
- if true, the output stream will be closed
java.io.IOException
- if there is any failurepublic static void stringToGZippedFile(java.lang.String s, java.io.File f) throws java.io.IOException
java.io.IOException
public static void stringToFile(java.lang.String s, java.io.File f) throws java.io.IOException
s
to f
using the platform's default encoding.
s
- the string to be written to filef
- the destination file
java.io.IOException
public static void stringToFile(java.lang.String s, java.io.File f, java.lang.String encoding) throws java.io.IOException
s
to f
using specified encoding.
s
- the string to be written to filef
- the destination fileencoding
- the desired encoding
java.io.IOException
public static void remoteCopyFile(java.lang.String srcHost, java.lang.String srcPath, java.lang.String dstHost, java.lang.String dstPath) throws java.io.IOException
srcHost
- host to send from (null if file is local)srcPath
- path on srcHost to read fromdstHost
- host to send to (null if file is local)dstPath
- path on srcHost to write to
java.io.IOException
public static void remoteCopyFile(java.io.File srcFile, java.lang.String dstHost, java.lang.String dstPath) throws java.io.IOException
srcFile
- local file to senddstHost
- host to send to (null if file is local)dstPath
- path on srcHost to write to
java.io.IOException
public static void remoteCopyFile(java.lang.String srcHost, java.lang.String srcPath, java.io.File dstFile) throws java.io.IOException
srcHost
- host to send from (null if file is local)srcPath
- path on srcHost to read fromdstFile
- local file to write to
java.io.IOException
public static java.lang.String stringFromGZippedFile(java.io.File f) throws java.io.IOException
f
- file to read
java.io.IOException
public static java.lang.String stringFromFile(java.io.File f) throws java.io.IOException
f
- file to read
java.io.IOException
public static java.lang.String stringFromFile(java.io.File f, java.lang.String encoding) throws java.io.IOException
f
- file to readencoding
- to be used, null will use the default
java.io.IOException
public static java.lang.String pathForResourceNamed(java.lang.String fileName, java.lang.String frameworkName, com.webobjects.foundation.NSArray languages)
fileName
- name of the fileframeworkName
- name of the framework, null or "app"
for the application bundle
public static boolean resourceExists(java.lang.String fileName, java.lang.String frameworkName, com.webobjects.foundation.NSArray languages)
fileName
- name of the fileframeworkName
- name of the framework, null or "app"
for the application bundle
public static java.io.InputStream inputStreamForResourceNamed(java.lang.String fileName, java.lang.String frameworkName, com.webobjects.foundation.NSArray languages)
fileName
- name of the fileframeworkName
- name of the framework, null or "app"
for the application bundle
public static java.lang.String datePathWithRoot(java.lang.String rootPath)
rootPath
- Root of the path before the above the date directories
public static java.net.URL pathURLForResourceNamed(java.lang.String fileName, java.lang.String frameworkName, com.webobjects.foundation.NSArray languages)
fileName
- name of the fileframeworkName
- name of the framework, null or "app"
for the application bundle
public static java.net.URL URLFromFile(java.io.File file)
file
- name of the file
public static java.net.URL URLFromPath(java.lang.String fileName)
fileName
- path of the file
public static long lastModifiedDateForFileInFramework(java.lang.String fileName, java.lang.String frameworkName)
fileName
- name of the fileframeworkName
- name of the framework, null or "app"
for the application bundle
lastModified
method off of the
file objectpublic static java.lang.Object readPropertyListFromFileInFramework(java.lang.String fileName, java.lang.String aFrameWorkName)
fileName
- name of the fileaFrameWorkName
- name of the framework, null or
'app' for the application bundle.
public static java.lang.Object readPropertyListFromFileInFramework(java.lang.String fileName, java.lang.String aFrameWorkName, java.lang.String encoding)
fileName
- name of the fileaFrameWorkName
- name of the framework, null or
'app' for the application bundle.encoding
- the encoding used with fileName
public static java.lang.Object readPropertyListFromFileInFramework(java.lang.String fileName, java.lang.String aFrameWorkName, com.webobjects.foundation.NSArray languageList)
fileName
- name of the fileaFrameWorkName
- name of the framework, null or
'app' for the application bundle.languageList
- language list search order
public static java.lang.Object readPropertyListFromFileInFramework(java.lang.String fileName, java.lang.String aFrameWorkName, com.webobjects.foundation.NSArray languageList, java.lang.String encoding)
fileName
- name of the fileaFrameWorkName
- name of the framework, null or
'app' for the application bundle.languageList
- language list search orderencoding
- the encoding used with fileName
public static void deleteFilesInDirectory(java.io.File directory, boolean recurseIntoDirectories)
directory
- to delete all of the files fromrecurseIntoDirectories
- determines if the delete is recursivepublic static void deleteFilesInDirectory(java.io.File directory, java.io.FileFilter filter, boolean recurseIntoDirectories, boolean removeDirectories)
directory
- to delete all of the files fromfilter
- optional FileFilter to restrict what gets deleted, null to delete everythingrecurseIntoDirectories
- determines if the delete is recursiveremoveDirectories
- true if directories should be removed as well as files, false to only remove filespublic static boolean deleteDirectory(java.io.File directory)
directory
- to be deleted
public static void chmod(java.io.File file, java.lang.String mode) throws java.io.IOException
file
- the File to run chmod onmode
- see the chmod man page
java.io.IOException
- if things go wrongpublic static void chmodRecursively(java.io.File dir, java.lang.String mode) throws java.io.IOException
dir
- the File to run chmod onmode
- see the chmod man page
java.io.IOException
- if things go wrongpublic static void linkFiles(java.io.File source, java.io.File destination, boolean symbolic, boolean allowUnlink, boolean followSymbolicLinks) throws java.io.IOException
source
- to create the link todestination
- file to create the link tosymbolic
- determines if a symlink should be createdallowUnlink
- determines if the symlink is a hardlink which allows unlinkingfollowSymbolicLinks
- If the destination is a symbolic link, follow it
java.io.IOException
public static void copyFilesFromDirectory(java.io.File srcDirectory, java.io.File dstDirectory, boolean deleteOriginals, boolean recursiveCopy, java.io.FileFilter filter) throws java.io.FileNotFoundException, java.io.IOException
srcDirectory
- source directorydstDirectory
- destination directorydeleteOriginals
- tells if the original files, the file is deleted even if appuser has no write
rights. This is compareable to a rm -f filename
instead of rm filename
recursiveCopy
- specifies if directories should be recursively copiedfilter
- which restricts the files to be copied
java.io.FileNotFoundException
java.io.IOException
public static void copyFilesFromDirectory(java.io.File srcDirectory, java.io.File dstDirectory, boolean deleteOriginals, boolean replaceExistingFiles, boolean recursiveCopy, java.io.FileFilter filter) throws java.io.FileNotFoundException, java.io.IOException
srcDirectory
- source directorydstDirectory
- destination directorydeleteOriginals
- tells if the original files, the file is deleted even if appuser has no write
rights. This is compareable to a rm -f filename
instead of rm filename
replaceExistingFiles
- true if the destination should be overwritten if it already existsrecursiveCopy
- specifies if directories should be recursively copiedfilter
- which restricts the files to be copied
java.io.FileNotFoundException
java.io.IOException
public static void copyFileToFile(java.io.File srcFile, java.io.File dstFile, boolean deleteOriginals, boolean forceDelete) throws java.io.FileNotFoundException, java.io.IOException
srcFile
- source filedstFile
- destination filedeleteOriginals
- tells if original file will be deleted. Note that if the appuser has no write rights
on the file it is NOT deleted unless force delete is trueforceDelete
- if true then missing write rights are ignored and the file is deleted.
java.io.FileNotFoundException
java.io.IOException
public static final java.io.File createTempDir() throws java.io.IOException
java.io.IOException
- if something goes wrongpublic static final java.io.File createTempDir(java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
java.io.IOException
- if something goes wrongpublic static com.webobjects.foundation.NSArray<java.io.File> arrayByAddingFilesInDirectory(java.io.File directory, boolean recursive)
directory
- the directory from which to add the filesrecursive
- if true then files are added recursively meaning subdirectories are scanned, too.
public static java.lang.String replaceFileExtension(java.lang.String path, java.lang.String newExtension)
path
- the path of the file.newExtension
- the new extension.
public static java.io.File unzipFile(java.io.File f, java.io.File destination) throws java.io.IOException
null
then the System Property
"java.io.tmpdir" is used as destination for the
uncompressed file(s).
f
- The file to unzipdestination
- the destination directory. If directory is null then the file will be unzipped in
java.io.tmpdir, if it does not exist, then a directory is created and if it exists but is a file
then the destination is set to the directory in which the file is located.
java.io.IOException
public static java.io.File zipFile(java.io.File f, boolean absolutePaths, boolean deleteOriginal, boolean forceDelete) throws java.io.IOException
f
- the file to zip, either a file or a directoryabsolutePaths
- if true
then the files are added with absolute pathsdeleteOriginal
- if true
then the original file is deletedforceDelete
- if true
then the original is deleted even if the file is read only
java.io.IOException
public static java.io.File zipFile(java.io.File f, boolean absolutePaths, boolean deleteOriginal, boolean forceDelete, int level) throws java.io.IOException
java.io.IOException
public static byte[] md5(java.io.File file) throws java.io.IOException
file
- the file to sum
java.io.IOException
public static byte[] md5(java.io.InputStream in) throws java.io.IOException
in
- the input stream to sum
java.io.IOException
public static java.lang.String md5Hex(java.io.File file) throws java.io.IOException
file
- the file to sum
java.io.IOException
public static java.lang.String md5Hex(java.io.InputStream in) throws java.io.IOException
in
- the input stream to sum
java.io.IOException
public static long length(java.io.File f)
public static java.lang.String shortenFilename(java.lang.String name, int maxLength)
name
- the name to modifymaxLength
- the maximum length of the name.
maxLength
values under 4 have no effect, the returned string is
always a....java
public static java.lang.String removeFileExtension(java.lang.String name)
name
- the name of the file
public static java.lang.String fileExtension(java.lang.String name)
name
- the name of the file
public static boolean deleteFiles(com.webobjects.foundation.NSMutableArray filesToDelete)
filesToDelete
- public static boolean deleteFile(java.io.File fileToDelete)
public static java.io.File[] listDirectories(java.io.File baseDir, boolean recursive)
baseDir
- the dir from which to list the child directoriesrecursive
- if true this methods works recursively
public static java.io.File[] listFiles(java.io.File baseDir, boolean recursive, java.io.FileFilter filter)
baseDir
- the dir from which to list the child filesrecursive
- if true this method works recursivelyfilter
- filter to match the files against. If null, all files will be included.
public static void renameTo(java.io.File source, java.io.File destination) throws java.io.FileNotFoundException, java.io.IOException
source
- destination
-
java.io.IOException
java.io.FileNotFoundException
public static java.lang.String fileNameFromBrowserSubmittedPath(java.lang.String path)
path
- the full path from the browser
public static java.io.File reserveUniqueFile(java.io.File desiredFile, boolean overwrite) throws java.io.IOException
desiredFile
- the desired destination file to writeoverwrite
- if true, this will immediately return desiredFile
java.io.IOException
- if the file cannot be created
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |