ATS-488 : Remove alfresco-core dependency (#90)

- remove *alfresco-core* dependency
- remove *alfresco-data-model* dependency
- replace _TempFileProvider_ with local implementation
- duplicate _RuntimeExec_ and _ExecParameterTokenizer_ from alfresco-core
- partially duplicate _MimetypeMap_ from alfresco-data-model
This commit is contained in:
CezarLeahu
2019-08-20 10:05:39 +03:00
committed by GitHub
parent 1f47cd47b4
commit bb187dc00f
33 changed files with 1597 additions and 329 deletions

View File

@@ -48,24 +48,9 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<!-- HtmlParserContentTransformer -->

View File

@@ -1,36 +0,0 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
# - Apache 2
# - Apache 2.0
# - Apache License 2.0
# - Apache License, Version 2.0
# - Apache License, version 2.0
# - BSD 3-clause New License
# - BSD License
# - CDDL + GPLv2 with classpath exception
# - CDDL 1.1
# - CDDL+GPL License
# - CDDL/GPLv2+CE
# - Common Public License
# - Eclipse Distribution License - v 1.0
# - Eclipse Public License - v 1.0
# - GNU Lesser General Public License
# - GNU Lesser General Public License v2.1
# - GPL2 w/ CPE
# - MIT License
# - MIT license
# - Public Domain, per Creative Commons CC0
# - Sun Binary Code License Agreement
# - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0
# - The JSON License
# - The MIT License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
#Tue Jul 09 13:38:31 EEST 2019
javax.transaction--jta--1.1=Sun Binary Code License Agreement
commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0
org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0

View File

@@ -40,7 +40,6 @@ import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.slf4j.Logger;
@@ -113,13 +112,13 @@ public class AppleIWorksContentTransformer implements SelectableTransformer
if (!found)
{
throw new AlfrescoRuntimeException(
throw new RuntimeException(
"The source " + sourceMimetype + " file did not contain a " + targetMimetype + " preview");
}
}
catch (IOException e)
{
throw new AlfrescoRuntimeException(
throw new RuntimeException(
"Unable to transform " + sourceMimetype + " file. It should have been a zip format file.",
e);
}

View File

@@ -55,7 +55,6 @@ import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
@@ -148,7 +147,7 @@ public class OOXMLThumbnailContentTransformer implements SelectableTransformer
}
catch (IOException e)
{
throw new AlfrescoRuntimeException("Unable to transform file.", e);
throw new RuntimeException("Unable to transform file.", e);
}
}

View File

@@ -34,7 +34,6 @@ import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.transform.exceptions.TransformException;
import org.alfresco.transformer.logging.LogEntry;
import org.slf4j.Logger;
@@ -117,7 +116,7 @@ public class SelectingTransformer
return transformer;
}
}
throw new AlfrescoRuntimeException(
throw new RuntimeException(
"Could not select a transformer for sourceMimetype=" + sourceMimetype
+ " targetMimetype=" + targetMimetype);
}

View File

@@ -46,7 +46,6 @@ import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
@@ -86,7 +85,7 @@ public class TextToPdfContentTransformer implements SelectableTransformer
}
catch (Throwable e)
{
throw new AlfrescoRuntimeException(
throw new RuntimeException(
"Unable to set Standard Font for PDF generation: " + fontName, e);
}
}
@@ -99,7 +98,7 @@ public class TextToPdfContentTransformer implements SelectableTransformer
}
catch (Throwable e)
{
throw new AlfrescoRuntimeException(
throw new RuntimeException(
"Unable to set Font Size for PDF generation: " + fontSize);
}
}

View File

@@ -45,7 +45,6 @@ import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transformer.transformers.SelectingTransformer;
import org.apache.pdfbox.pdmodel.PDDocument;
@@ -165,7 +164,7 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
}
catch (UnsupportedEncodingException e)
{
throw new AlfrescoRuntimeException("Encoding not recognised", e);
throw new RuntimeException("Encoding not recognised", e);
}
MvcResult result = sendText("txt",