Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
Static Public Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.coreutils.FileUtil Class Reference

Static Public Member Functions

static boolean deleteDir (File dirPath)
 
static boolean deleteFileDir (File path)
 
static String copyFile (String source, String destFolder, String newName, String ext, boolean overwrite) throws IOException
 
static String copyFolder (String source, String path, String folderName) throws IOException
 
static String escapeFileName (String fileName)
 

Static Private Attributes

static final Logger logger = Logger.getLogger(FileUtil.class.getName())
 

Detailed Description

File and dir utilities

Definition at line 29 of file FileUtil.java.

Member Function Documentation

static String org.sleuthkit.autopsy.coreutils.FileUtil.copyFile ( String  source,
String  destFolder,
String  newName,
String  ext,
boolean  overwrite 
) throws IOException
static

Copy a file to a new directory, potentially new file name, and overwrite old one if requested

Parameters
sourcesource file path
destFolderdestination folder path
newNamefile name of the copied file, which can be different from original
extfile extension, e.g. ".java"
overwriteif new file, already exists, overwrite it (delete it first)
Returns
path to the created file, or null if file was not created
Exceptions
IOExceptionexception thrown if file copying failed

Definition at line 103 of file FileUtil.java.

static String org.sleuthkit.autopsy.coreutils.FileUtil.copyFolder ( String  source,
String  path,
String  folderName 
) throws IOException
static

Copy a folder into a new directory.

Parameters
sourcepath to the source folder
pathdestination path of the new folder
folderNamename of the new folder
Returns
path to the new folder if created, null if it was not created
Exceptions
IOExceptionexception thrown if file copying failed

Definition at line 138 of file FileUtil.java.

static boolean org.sleuthkit.autopsy.coreutils.FileUtil.deleteDir ( File  dirPath)
static

Recursively delete all of the files and sub-directories in a directory. Use deleteFileDir() if you are not sure if the path is a file or directory.

Parameters
dirPathPath of the directory to delete
Returns
true if the dir was deleted with no errors. False otherwise (including if the passed in path was for a file).

Definition at line 40 of file FileUtil.java.

Referenced by org.sleuthkit.autopsy.coreutils.FileUtil.deleteFileDir().

static boolean org.sleuthkit.autopsy.coreutils.FileUtil.deleteFileDir ( File  path)
static

Delete the file or dir at the given path. If the path is for a directory, recursively delete its contents.

Parameters
paththe path to the file or directory to delete
Returns
true if the file or directory were deleted with no errors. False otherwise.

Definition at line 78 of file FileUtil.java.

References org.sleuthkit.autopsy.coreutils.FileUtil.deleteDir().

Referenced by org.sleuthkit.autopsy.directorytree.ExtractAction.runExtractionTasks().

static String org.sleuthkit.autopsy.coreutils.FileUtil.escapeFileName ( String  fileName)
static

Escape special characters in a file name or a file name component

Parameters
fileNameto escape
Returns
escaped string

Definition at line 155 of file FileUtil.java.

Member Data Documentation

final Logger org.sleuthkit.autopsy.coreutils.FileUtil.logger = Logger.getLogger(FileUtil.class.getName())
staticprivate

Definition at line 31 of file FileUtil.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.