Merge pull request #6444 from eugene7646/solr-8-upgrade

Merged develop
This commit is contained in:
eugene7646 2020-11-06 15:54:27 -05:00 committed by GitHub
commit e59d9cc9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 156 additions and 122 deletions

182
.gitignore vendored Normal file → Executable file
View File

@ -1,91 +1,91 @@
/dist/ /dist/
/build/ /build/
/*/build/ /*/build/
*/nbproject/private/* */nbproject/private/*
/nbproject/private/* /nbproject/private/*
/Core/release/ /Core/release/
/Core/src/org/sleuthkit/autopsy/coreutils/Version.properties /Core/src/org/sleuthkit/autopsy/coreutils/Version.properties
/Core/src/org/sleuthkit/autopsy/casemodule/docs/QuickStart.html /Core/src/org/sleuthkit/autopsy/casemodule/docs/QuickStart.html
/Core/src/org/sleuthkit/autopsy/casemodule/docs/screenshot.png /Core/src/org/sleuthkit/autopsy/casemodule/docs/screenshot.png
/Core/src/org/sleuthkit/autopsy/datamodel/ranges.csv /Core/src/org/sleuthkit/autopsy/datamodel/ranges.csv
/Core/build/ /Core/build/
/Core/dist/ /Core/dist/
/Core/nbproject/* /Core/nbproject/*
/Core/test/qa-functional/data/* /Core/test/qa-functional/data/*
!/Core/nbproject/project.xml !/Core/nbproject/project.xml
!/Core/nbproject/project.properties !/Core/nbproject/project.properties
/CoreLibs/release/ /CoreLibs/release/
/CoreLibs/build/ /CoreLibs/build/
/CoreLibs/dist/ /CoreLibs/dist/
/CoreLibs/nbproject/* /CoreLibs/nbproject/*
!/CoreLibs/nbproject/project.xml !/CoreLibs/nbproject/project.xml
!/CoreLibs/nbproject/project.properties !/CoreLibs/nbproject/project.properties
/Core/test/qa-functional/data/ /Core/test/qa-functional/data/
/KeywordSearch/release/ /KeywordSearch/release/
/KeywordSearch/build/ /KeywordSearch/build/
/KeywordSearch/dist/ /KeywordSearch/dist/
/KeywordSearch/nbproject/* /KeywordSearch/nbproject/*
!/KeywordSearch/nbproject/project.xml !/KeywordSearch/nbproject/project.xml
!/KeywordSearch/nbproject/project.properties !/KeywordSearch/nbproject/project.properties
*/genfiles.properties */genfiles.properties
genfiles.properties genfiles.properties
/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties /branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties /branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties
/branding/build/ /branding/build/
/branding/dist/ /branding/dist/
/branding/nbproject/* /branding/nbproject/*
!/branding/nbproject/project.xml !/branding/nbproject/project.xml
!/branding/nbproject/project.properties !/branding/nbproject/project.properties
/test/input/* /test/input/*
!/test/input/notablehashes.txt-md5.idx !/test/input/notablehashes.txt-md5.idx
!/test/input/notablekeywords.xml !/test/input/notablekeywords.xml
!/test/input/NSRL.txt-md5.idx !/test/input/NSRL.txt-md5.idx
/test/output/* /test/output/*
!/test/output/gold !/test/output/gold
/test/script/output_dir_link.txt /test/script/output_dir_link.txt
/test/output/gold/tmp /test/output/gold/tmp
/test/script/ScriptLog.txt /test/script/ScriptLog.txt
/test/script/__pycache__/ /test/script/__pycache__/
/test/script/*.pyc /test/script/*.pyc
/test/script/DBDump-Diff.txt /test/script/DBDump-Diff.txt
/test/script/DBDump.txt /test/script/DBDump.txt
/test/script/SortedData-Diff.txt /test/script/SortedData-Diff.txt
/test/script/SortedData.txt /test/script/SortedData.txt
/test/script/myconfig.xml /test/script/myconfig.xml
/test/script/*/*.xml /test/script/*/*.xml
/test/build/ /test/build/
/test/dist/ /test/dist/
/test/nbproject/* /test/nbproject/*
!/Testing/nbproject/project.xml !/Testing/nbproject/project.xml
!/Testing/nbproject/project.properties !/Testing/nbproject/project.properties
*~ *~
/netbeans-plat /netbeans-plat
/docs/doxygen-user/user-docs /docs/doxygen-user/user-docs
/jdiff-javadocs/* /jdiff-javadocs/*
/jdiff-logs/* /jdiff-logs/*
/gen_version.txt /gen_version.txt
hs_err_pid*.log hs_err_pid*.log
.DS_Store .DS_Store
.*.swp .*.swp
/Experimental/release/ /Experimental/release/
/ImageGallery/release/ /ImageGallery/release/
/thunderbirdparser/release/ /thunderbirdparser/release/
/RecentActivity/release/ /RecentActivity/release/
/CentralRepository/release/ /CentralRepository/release/
/Tika/release /Tika/release
.idea/ .idea/
*.iml *.iml
*.img *.img
*.vhd *.vhd
*.E01 *.E01

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2012-2014 Basis Technology Corp. * Copyright 2012-2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -54,6 +54,40 @@ import org.xml.sax.SAXException;
* -Loading documents from disk * -Loading documents from disk
*/ */
public class XMLUtil { public class XMLUtil {
private static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException {
// See JIRA-6958 for details about class loading and jaxb.
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(XMLUtil.class.getClassLoader());
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
return builderFactory.newDocumentBuilder();
} finally {
Thread.currentThread().setContextClassLoader(original);
}
}
private static SchemaFactory getSchemaFactory(String schemaLanguage) {
// See JIRA-6958 for details about class loading and jaxb.
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(XMLUtil.class.getClassLoader());
return SchemaFactory.newInstance(schemaLanguage);
} finally {
Thread.currentThread().setContextClassLoader(original);
}
}
private static TransformerFactory getTransformerFactory() {
// See JIRA-6958 for details about class loading and jaxb.
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(XMLUtil.class.getClassLoader());
return TransformerFactory.newInstance();
} finally {
Thread.currentThread().setContextClassLoader(original);
}
}
/** /**
* Creates a W3C DOM. * Creates a W3C DOM.
@ -63,9 +97,7 @@ public class XMLUtil {
* @throws ParserConfigurationException * @throws ParserConfigurationException
*/ */
public static Document createDocument() throws ParserConfigurationException { public static Document createDocument() throws ParserConfigurationException {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); return getDocumentBuilder().newDocument();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
return builder.newDocument();
} }
/** /**
@ -100,8 +132,7 @@ public class XMLUtil {
* @throws IOException * @throws IOException
*/ */
public static Document loadDocument(String docPath) throws ParserConfigurationException, SAXException, IOException { public static Document loadDocument(String docPath) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = getDocumentBuilder();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document doc = builder.parse(new FileInputStream(docPath)); Document doc = builder.parse(new FileInputStream(docPath));
return doc; return doc;
} }
@ -119,7 +150,7 @@ public class XMLUtil {
public static <T> void validateDocument(final Document doc, Class<T> clazz, String schemaResourceName) throws SAXException, IOException { public static <T> void validateDocument(final Document doc, Class<T> clazz, String schemaResourceName) throws SAXException, IOException {
PlatformUtil.extractResourceToUserConfigDir(clazz, schemaResourceName, false); PlatformUtil.extractResourceToUserConfigDir(clazz, schemaResourceName, false);
File schemaFile = new File(Paths.get(PlatformUtil.getUserConfigDirectory(), schemaResourceName).toAbsolutePath().toString()); File schemaFile = new File(Paths.get(PlatformUtil.getUserConfigDirectory(), schemaResourceName).toAbsolutePath().toString());
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); SchemaFactory schemaFactory = getSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(schemaFile); Schema schema = schemaFactory.newSchema(schemaFile);
Validator validator = schema.newValidator(); Validator validator = schema.newValidator();
validator.validate(new DOMSource(doc), new DOMResult()); validator.validate(new DOMSource(doc), new DOMResult());
@ -140,7 +171,7 @@ public class XMLUtil {
* @throws IOException * @throws IOException
*/ */
public static void saveDocument(final Document doc, String encoding, String docPath) throws TransformerConfigurationException, FileNotFoundException, UnsupportedEncodingException, TransformerException, IOException { public static void saveDocument(final Document doc, String encoding, String docPath) throws TransformerConfigurationException, FileNotFoundException, UnsupportedEncodingException, TransformerException, IOException {
TransformerFactory xf = TransformerFactory.newInstance(); TransformerFactory xf = getTransformerFactory();
xf.setAttribute("indent-number", 1); //NON-NLS xf.setAttribute("indent-number", 1); //NON-NLS
Transformer xformer = xf.newTransformer(); Transformer xformer = xf.newTransformer();
xformer.setOutputProperty(OutputKeys.METHOD, "xml"); //NON-NLS xformer.setOutputProperty(OutputKeys.METHOD, "xml"); //NON-NLS
@ -178,7 +209,7 @@ public class XMLUtil {
try { try {
PlatformUtil.extractResourceToUserConfigDir(clazz, schemaFile, false); PlatformUtil.extractResourceToUserConfigDir(clazz, schemaFile, false);
File schemaLoc = new File(PlatformUtil.getUserConfigDirectory() + File.separator + schemaFile); File schemaLoc = new File(PlatformUtil.getUserConfigDirectory() + File.separator + schemaFile);
SchemaFactory schm = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); SchemaFactory schm = getSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI);
try { try {
Schema schema = schm.newSchema(schemaLoc); Schema schema = schm.newSchema(schemaLoc);
Validator validator = schema.newValidator(); Validator validator = schema.newValidator();
@ -226,10 +257,9 @@ public class XMLUtil {
*/ */
// TODO: Deprecate. // TODO: Deprecate.
public static <T> Document loadDoc(Class<T> clazz, String xmlPath) { public static <T> Document loadDoc(Class<T> clazz, String xmlPath) {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
Document ret = null; Document ret = null;
try { try {
DocumentBuilder builder = builderFactory.newDocumentBuilder(); DocumentBuilder builder = getDocumentBuilder();
ret = builder.parse(new FileInputStream(xmlPath)); ret = builder.parse(new FileInputStream(xmlPath));
} catch (ParserConfigurationException e) { } catch (ParserConfigurationException e) {
Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file " + xmlPath + " : can't initialize parser.", e); //NON-NLS Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file " + xmlPath + " : can't initialize parser.", e); //NON-NLS
@ -268,7 +298,7 @@ public class XMLUtil {
*/ */
// TODO: Deprecate. // TODO: Deprecate.
public static <T> boolean saveDoc(Class<T> clazz, String xmlPath, String encoding, final Document doc) { public static <T> boolean saveDoc(Class<T> clazz, String xmlPath, String encoding, final Document doc) {
TransformerFactory xf = TransformerFactory.newInstance(); TransformerFactory xf = getTransformerFactory();
xf.setAttribute("indent-number", 1); //NON-NLS xf.setAttribute("indent-number", 1); //NON-NLS
boolean success = false; boolean success = false;
try { try {

View File

@ -117,6 +117,12 @@ public final class EmbeddedFileExtractorIngestModule extends FileIngestModuleAda
* while processing archive files. * while processing archive files.
*/ */
mapOfDepthTrees.put(jobId, new ConcurrentHashMap<>()); mapOfDepthTrees.put(jobId, new ConcurrentHashMap<>());
/**
* Initialize Java's Image I/O API so that image reading and writing
* (needed for image extraction) happens consistently through the
* same providers. See JIRA-6951 for more details.
*/
initializeImageIO();
} }
/* /*
* Construct an embedded content extractor for processing Microsoft * Construct an embedded content extractor for processing Microsoft
@ -127,14 +133,6 @@ public final class EmbeddedFileExtractorIngestModule extends FileIngestModuleAda
} catch (NoCurrentCaseException ex) { } catch (NoCurrentCaseException ex) {
throw new IngestModuleException(Bundle.EmbeddedFileExtractorIngestModule_UnableToGetMSOfficeExtractor_errMsg(), ex); throw new IngestModuleException(Bundle.EmbeddedFileExtractorIngestModule_UnableToGetMSOfficeExtractor_errMsg(), ex);
} }
/**
* Initialize Java's Image I/O API so that image reading and writing
* (needed for image extraction) happens consistently through the
* same providers. See JIRA-6951 for more details.
*/
initializeImageIO();
} }
/** /**

View File

@ -228,12 +228,19 @@ public class STIXReportModule implements GeneralReportModule {
*/ */
private STIXPackage loadSTIXFile(String stixFileName) throws JAXBException { private STIXPackage loadSTIXFile(String stixFileName) throws JAXBException {
// Create STIXPackage object from xml. // Create STIXPackage object from xml.
File file = new File(stixFileName); // See JIRA-6958 for details about class loading and jaxb.
JAXBContext jaxbContext = JAXBContext.newInstance("org.mitre.stix.stix_1:org.mitre.stix.common_1:org.mitre.stix.indicator_2:" //NON-NLS ClassLoader original = Thread.currentThread().getContextClassLoader();
+ "org.mitre.cybox.objects:org.mitre.cybox.cybox_2:org.mitre.cybox.common_2"); //NON-NLS try {
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Thread.currentThread().setContextClassLoader(STIXReportModule.class.getClassLoader());
STIXPackage stix = (STIXPackage) jaxbUnmarshaller.unmarshal(file); File file = new File(stixFileName);
return stix; JAXBContext jaxbContext = JAXBContext.newInstance("org.mitre.stix.stix_1:org.mitre.stix.common_1:org.mitre.stix.indicator_2:" //NON-NLS
+ "org.mitre.cybox.objects:org.mitre.cybox.cybox_2:org.mitre.cybox.common_2"); //NON-NLS
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
STIXPackage stix = (STIXPackage) jaxbUnmarshaller.unmarshal(file);
return stix;
} finally {
Thread.currentThread().setContextClassLoader(original);
}
} }
/** /**

View File

@ -1,3 +1,2 @@
/nbproject/private/ /nbproject/private/
/build/ /build/

View File

@ -106,7 +106,7 @@
<copy file="${basedir}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/> <copy file="${basedir}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/>
<copy file="${basedir}/Running_Linux_OSX.txt" tofile="${zip-tmp}/${app.name}/Running_Linux_OSX.txt"/> <copy file="${basedir}/Running_Linux_OSX.txt" tofile="${zip-tmp}/${app.name}/Running_Linux_OSX.txt"/>
<copy file="${basedir}/unix_setup.sh" tofile="${zip-tmp}/${app.name}/unix_setup.sh"/> <copy file="${basedir}/unix_setup.sh" tofile="${zip-tmp}/${app.name}/unix_setup.sh"/>
<copy file="${basedir}/ManifestTool/ManifestTool.exe" todir="${zip-tmp}/${app.name}/bin"/> <copy file="${basedir}/Tools/ManifestTool/ManifestTool.exe" todir="${zip-tmp}/${app.name}/bin"/>
<copy file="${basedir}/icons/icon.ico" tofile="${zip-tmp}/${app.name}/icon.ico" overwrite="true"/> <copy file="${basedir}/icons/icon.ico" tofile="${zip-tmp}/${app.name}/icon.ico" overwrite="true"/>
@ -117,10 +117,10 @@
<!-- Copy the ZooKeeper migration tool, it's JAR files, and documentation --> <!-- Copy the ZooKeeper migration tool, it's JAR files, and documentation -->
<copy flatten="false" todir="${zip-tmp}/${app.name}/autopsy/ZookeeperNodeMigration"> <copy flatten="false" todir="${zip-tmp}/${app.name}/autopsy/ZookeeperNodeMigration">
<fileset dir="${basedir}/ZookeeperNodeMigration/dist"/> <fileset dir="${basedir}/Tools/ZookeeperNodeMigration/dist"/>
</copy> </copy>
<copy flatten="false" todir="${zip-tmp}/${app.name}/autopsy/ZookeeperNodeMigration" overwrite="true"> <copy flatten="false" todir="${zip-tmp}/${app.name}/autopsy/ZookeeperNodeMigration" overwrite="true">
<fileset dir="${basedir}/ZookeeperNodeMigration/docs"/> <fileset dir="${basedir}/Tools/ZookeeperNodeMigration/docs"/>
</copy> </copy>
<property name="app.property.file" value="${zip-tmp}/${app.name}/etc/${app.name}.conf" /> <property name="app.property.file" value="${zip-tmp}/${app.name}/etc/${app.name}.conf" />