mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
6040 adjust comments
This commit is contained in:
parent
6823ee858b
commit
314007f940
@ -95,8 +95,6 @@ final class DiscoveryUiUtils {
|
|||||||
return comp instanceof JComponent && point.x >= comp.getX() && point.x <= comp.getX() + ICON_SIZE && point.y >= comp.getY() && point.y <= comp.getY() + ICON_SIZE;
|
return comp instanceof JComponent && point.x >= comp.getX() && point.x <= comp.getX() + ICON_SIZE && point.y >= comp.getY() && point.y <= comp.getY() + ICON_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to set the icon and tool tip text for a label to show deleted
|
* Method to set the icon and tool tip text for a label to show deleted
|
||||||
* status.
|
* status.
|
||||||
|
@ -247,6 +247,14 @@ class FileSearch {
|
|||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a summary for the specified AbstractFile if no summarizers exist get
|
||||||
|
* the first bit of the file.
|
||||||
|
*
|
||||||
|
* @param file The AbstractFile to summarize.
|
||||||
|
*
|
||||||
|
* @return The summary or first bit of the specified file as a String.
|
||||||
|
*/
|
||||||
@NbBundle.Messages({"FileSearch.documentSummary.noPreview=No preview available.",
|
@NbBundle.Messages({"FileSearch.documentSummary.noPreview=No preview available.",
|
||||||
"FileSearch.documentSummary.noBytes=No bytes read for document, unable to display preview."})
|
"FileSearch.documentSummary.noBytes=No bytes read for document, unable to display preview."})
|
||||||
static String summarize(AbstractFile file) {
|
static String summarize(AbstractFile file) {
|
||||||
@ -263,9 +271,11 @@ class FileSearch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (localSummarizer == null) {
|
if (localSummarizer == null) {
|
||||||
|
//no summarizer was found just grab the first bit of the file
|
||||||
return getFirstLines(file);
|
return getFirstLines(file);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
//a summary of length 40 seems to fit without vertical scroll bars
|
||||||
return localSummarizer.summarize(file, 40);
|
return localSummarizer.summarize(file, 40);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
return Bundle.FileSearch_documentSummary_noPreview();
|
return Bundle.FileSearch_documentSummary_noPreview();
|
||||||
@ -274,6 +284,13 @@ class FileSearch {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the first bit of text from the specified AbstractFile.
|
||||||
|
*
|
||||||
|
* @param file The AbstractFile to get text from.
|
||||||
|
*
|
||||||
|
* @return The first bit of text from the specified AbstractFile.
|
||||||
|
*/
|
||||||
private static String getFirstLines(AbstractFile file) {
|
private static String getFirstLines(AbstractFile file) {
|
||||||
try (Reader reader = TextExtractorFactory.getExtractor(file, null).getReader()) {
|
try (Reader reader = TextExtractorFactory.getExtractor(file, null).getReader()) {
|
||||||
char[] cbuf = new char[PREVIEW_SIZE];
|
char[] cbuf = new char[PREVIEW_SIZE];
|
||||||
@ -286,6 +303,13 @@ class FileSearch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the first summarizer found by a lookup of summarizers.
|
||||||
|
*
|
||||||
|
* @return The first summarizer found by a lookup of summarizers.
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
private static Summarizer getLocalSummarizer() throws IOException {
|
private static Summarizer getLocalSummarizer() throws IOException {
|
||||||
Collection<? extends Summarizer> summarizers
|
Collection<? extends Summarizer> summarizers
|
||||||
= Lookup.getDefault().lookupAll(Summarizer.class
|
= Lookup.getDefault().lookupAll(Summarizer.class
|
||||||
@ -655,7 +679,6 @@ class FileSearch {
|
|||||||
int framePos = Integer.valueOf(FilenameUtils.getBaseName(fileName).substring(2));
|
int framePos = Integer.valueOf(FilenameUtils.getBaseName(fileName).substring(2));
|
||||||
framePositions[thumbnailNumber] = framePos;
|
framePositions[thumbnailNumber] = framePos;
|
||||||
thumbnailNumber++;
|
thumbnailNumber++;
|
||||||
|
|
||||||
}
|
}
|
||||||
thumbnailWrapper.setThumbnails(videoThumbnails, framePositions);
|
thumbnailWrapper.setThumbnails(videoThumbnails, framePositions);
|
||||||
}
|
}
|
||||||
@ -673,7 +696,6 @@ class FileSearch {
|
|||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
||||||
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
videoThumbnails.add(ImageUtils.getDefaultThumbnail());
|
||||||
return videoThumbnails;
|
return videoThumbnails;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private FileSearch() {
|
private FileSearch() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user