Made changes due to FsContent.getFileSystem now throwing TskCoreException.

This commit is contained in:
Tim McIver 2013-01-08 15:22:23 -05:00
parent e62b062aa7
commit a8f6393c8a
2 changed files with 22 additions and 19 deletions

View File

@ -162,31 +162,25 @@ class ViewContextAction extends AbstractAction {
@Override
public List<Content> visit(Directory drctr) {
ret.add(drctr);
if (drctr.isRoot()) {
return visit(drctr.getFileSystem());
} else {
try {
return drctr.getParentDirectory().accept(this);
} catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't get directory's parent directory", ex);
}
Content parent = null;
try {
parent = drctr.getParent();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Couldn't get parent of Directory: " + drctr, ex);
}
return ret;
return parent.accept(this);
}
@Override
public List<Content> visit(File file) {
ret.add(file);
if (file.isRoot()) {
return visit(file.getFileSystem());
} else {
try {
return file.getParentDirectory().accept(this);
} catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't get file's parent directory", ex);
}
Content parent = null;
try {
parent = file.getParent();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Couldn't get parent of File: " + file, ex);
}
return ret;
return parent.accept(this);
}
@Override

View File

@ -606,7 +606,16 @@ class IngestScheduler {
//skip files in root dir, starting with $, containing : (not default attributes)
//with meta address < 32, i.e. some special large NTFS and FAT files
final TskData.TSK_FS_TYPE_ENUM fsType = f.getFileSystem().getFsType();
FileSystem fs = null;
try {
fs = f.getFileSystem();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Could not get FileSystem for " + f, ex);
}
TskData.TSK_FS_TYPE_ENUM fsType = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_UNSUPP;
if (fs != null) {
fsType = fs.getFsType();
}
if ((fsType.getValue() & FAT_NTFS_FLAGS) == 0) {
//not fat or ntfs, accept all files