us.ihmc.utilities
Class FileTools
java.lang.Object
us.ihmc.utilities.FileTools
public class FileTools
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileTools
public FileTools()
concatenateFilesTogether
public static void concatenateFilesTogether(java.util.ArrayList<java.lang.String> filenames,
java.lang.String concatenatedFilename)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
getFilenameWithoutFileType
public static java.lang.String getFilenameWithoutFileType(java.lang.String filename)
getFileType
public static java.lang.String getFileType(java.lang.String filename)
getRootPathFromPath
public static java.lang.String getRootPathFromPath(java.lang.String path)
getFilenameFromPath
public static java.lang.String getFilenameFromPath(java.lang.String path)
getFileReader
public static java.io.BufferedReader getFileReader(java.lang.String filename)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
getFileWriter
public static java.io.PrintWriter getFileWriter(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
getFileWriterWithAppend
public static java.io.PrintWriter getFileWriterWithAppend(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
getFileDataOutputStream
public static java.io.DataOutputStream getFileDataOutputStream(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
getFileDataInputStream
public static java.io.DataInputStream getFileDataInputStream(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
showSaveFileDialogBox
public static java.io.File showSaveFileDialogBox(java.io.File parentFile,
java.awt.Component parentComponent)
- presents a "Save file" dialog box to the user, opened to the given parent
file, parented to the given component. Returns the chosen file, if any.
If the user cancelled the dialog, returns null.
- Parameters:
parentFile - FileparentComponent - Component
- Returns:
- File
countLinesInJavaFilesInDirectory
public static long countLinesInJavaFilesInDirectory(java.lang.String directory)
throws java.io.IOException
- Counts the number of lines in Java Files in directory
- Parameters:
directory - String
- Returns:
- long
- Throws:
java.io.IOException
getAllFilesInDirectoryRecursive
public static java.util.ArrayList<java.io.File> getAllFilesInDirectoryRecursive(java.io.File directory)
- Gets all files in the directory
through recursive calls
- Parameters:
directory - File
- Returns:
- ArrayList
getAllFilesInDirectoryWithSuffix
public static java.util.ArrayList<java.io.File> getAllFilesInDirectoryWithSuffix(java.lang.String suffix,
java.io.File directory)