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

Member Function Documentation

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

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

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)
path to the created file, or null if file was not created
IOExceptionexception thrown if file copying failed

Definition at line 103 of file

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

Copy a folder into a new directory.

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

Definition at line 138 of file

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

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.

dirPathPath of the directory to delete
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

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

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

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

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

Definition at line 78 of file

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)

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

fileNameto escape
escaped string

Definition at line 155 of file

Member Data Documentation

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

Definition at line 31 of file

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.