19 package org.sleuthkit.autopsy.contentviewers;
21 import java.awt.Component;
22 import org.openide.nodes.Node;
23 import org.openide.util.NbBundle;
24 import org.openide.util.NbBundle.Messages;
25 import org.openide.util.lookup.ServiceProvider;
46 customizeComponents();
54 @SuppressWarnings(
"unchecked")
56 private
void initComponents() {
58 jPopupMenu1 =
new javax.swing.JPopupMenu();
59 jScrollPane2 =
new javax.swing.JScrollPane();
60 jTextPane1 =
new javax.swing.JTextPane();
62 jTextPane1.setEditable(
false);
63 jScrollPane2.setViewportView(jTextPane1);
65 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
66 this.setLayout(layout);
67 layout.setHorizontalGroup(
68 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
69 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
71 layout.setVerticalGroup(
72 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
73 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
97 jTextPane1.setText(
"<html><body>" + str +
"</body></html>");
101 sb.append(
"<table>");
105 sb.append(
"</table>");
108 private void addRow(StringBuilder sb, String key, String value) {
109 sb.append(
"<tr><td>");
111 sb.append(
"</td><td>");
113 sb.append(
"</td></tr>");
116 @Messages({
"Metadata.tableRowTitle.mimeType=MIME Type"})
121 setText(NbBundle.getMessage(
this.getClass(),
"Metadata.nodeText.nonFilePassedIn"));
125 StringBuilder sb =
new StringBuilder();
129 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.name"), file.
getUniquePath());
131 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.name"), file.
getParentPath() +
"/" + file.
getName());
134 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.type"), file.
getType().getName());
135 addRow(sb, Bundle.Metadata_tableRowTitle_mimeType(), file.
getMIMEType());
136 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.size"), Long.toString(file.
getSize()));
137 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.fileNameAlloc"), file.
getDirFlagAsString());
138 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.metadataAlloc"), file.
getMetaFlagsAsString());
147 md5 = NbBundle.getMessage(this.getClass(),
"Metadata.tableRowContent.md5notCalc");
149 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.md5"), md5);
150 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.hashLookupResults"), file.
getKnown().toString());
152 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.internalid"), Long.toString(file.
getId()));
154 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.localPath"), file.
getLocalAbsPath());
165 FsContent fsFile = (FsContent) file;
167 sb.append(
"<hr /><pre>\n");
168 sb.append(NbBundle.getMessage(
this.getClass(),
"Metadata.nodeText.text"));
169 sb.append(
" <br /><br />");
171 sb.append(str).append(
"<br />");
173 sb.append(
"</pre>\n");
176 sb.append(NbBundle.getMessage(
this.getClass(),
"Metadata.nodeText.exceptionNotice.text")).append(ex.getLocalizedMessage());
179 setText(sb.toString());
180 jTextPane1.setCaretPosition(0);
181 this.setCursor(null);
186 return NbBundle.getMessage(this.getClass(),
"Metadata.title");
191 return NbBundle.getMessage(this.getClass(),
"Metadata.toolTip");
void endTable(StringBuilder sb)
static String getStringTime(long epochSeconds, TimeZone tzone)
String getMetaFlagsAsString()
void addRow(StringBuilder sb, String key, String value)
synchronized List< String > getMetaDataText()
TskData.TSK_DB_FILES_TYPE_ENUM getType()
String getDirFlagAsString()
javax.swing.JTextPane jTextPane1
synchronized String getUniquePath()
javax.swing.JPopupMenu jPopupMenu1
void customizeComponents()
TskData.FileKnown getKnown()
static void configureTextPaneAsHtml(JTextPane pane)
boolean isSupported(Node node)
DataContentViewer createInstance()
int isPreferred(Node node)
javax.swing.JScrollPane jScrollPane2
void startTable(StringBuilder sb)