20 package org.sleuthkit.autopsy.contentviewers;
22 import java.awt.Component;
23 import org.openide.nodes.Node;
24 import org.openide.util.NbBundle;
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)
103 jTextPane1.setText(
"<html><body>" + str +
"</body></html>");
107 sb.append(
"<table>");
111 sb.append(
"</table>");
114 private void addRow(StringBuilder sb, String key, String value) {
115 sb.append(
"<tr><td>");
117 sb.append(
"</td><td>");
119 sb.append(
"</td></tr>");
126 setText(NbBundle.getMessage(
this.getClass(),
"Metadata.nodeText.nonFilePassedIn"));
130 StringBuilder sb =
new StringBuilder();
134 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.name"), file.
getUniquePath());
136 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.name"), file.
getParentPath() +
"/" + file.
getName());
139 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.type"), file.
getType().getName());
140 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.size"),
new Long(file.
getSize()).toString() );
141 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.fileNameAlloc"), file.
getDirFlagAsString());
142 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.metadataAlloc"), file.
getMetaFlagsAsString());
150 md5 = NbBundle.getMessage(this.getClass(),
"Metadata.tableRowContent.md5notCalc");
152 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.md5"), md5);
153 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.hashLookupResults"), file.
getKnown().toString());
155 addRow(sb, NbBundle.getMessage(
this.getClass(),
"Metadata.tableRowTitle.internalid"),
new Long(file.
getId()).toString());
157 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)