Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion catalog/core/catalog-core-directorymonitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncy.version}</version>
<scope>test</scope>
</dependency>
Expand Down
3 changes: 2 additions & 1 deletion catalog/plugin/catalog-plugin-oauth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
siv-mode
</Embed-Dependency>
<Import-Package>
!jakarta.servlet.*,
org.codice.ddf.security.token.storage.api,
net.minidev.*;version="${json-smart.version}",
*
Expand All @@ -142,7 +143,7 @@
<configuration>
<rules>
<ArtifactSizeEnforcerRule implementation="org.codice.maven.artifactsize.ArtifactSizeEnforcerRule">
<maxArtifactSize>2.9_MB</maxArtifactSize>
<maxArtifactSize>3.2_MB</maxArtifactSize>
</ArtifactSizeEnforcerRule>
</rules>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected ApplicationOptions getApplicationOptions(PortFinder portFinder) {
@Override
protected BundleOption getBundleOptions() {
return super.getBundleOptions()
.add("org.bouncycastle", "bcprov-jdk15on")
.add("org.bouncycastle", "bcprov-jdk18on")
.add("ddf.catalog.transformer", "catalog-transformer-attribute")
.add("ddf.catalog.core", "catalog-core-attachment")
.add("ddf.catalog.rest", "catalog-rest-api")
Expand Down
2 changes: 1 addition & 1 deletion catalog/spatial/csw/spatial-csw-source-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncy.version}</version>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static Metacard createMetacard(

setAttribute(metacard, Contact.CREATOR_NAME, metadata.get(TikaCoreProperties.CREATOR));

setMultipleAttributes(metacard, Topic.KEYWORD, metadata.getValues(DublinCore.SUBJECT));
setMultipleAttributes(metacard, Topic.KEYWORD, metadata.getValues(TikaCoreProperties.SUBJECT));

setAttribute(
metacard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public String getMetadataText() {
}

private void handleException(SAXException se) throws SAXException {
if (WriteLimitReachedException.isWriteLimitReached(se)) {
if (se instanceof WriteLimitReachedException) {
bodyWriteLimitReached = true;
} else {
throw se;
Expand Down
11 changes: 6 additions & 5 deletions catalog/transformer/catalog-transformer-pdf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncy.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<artifactId>bcmail-jdk18on</artifactId>
<version>${bouncy.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bouncy.version}</version>
</dependency>
<dependency>
Expand All @@ -90,8 +90,7 @@
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<type>pom</type>
<artifactId>tika-parsers-standard-package</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -110,6 +109,8 @@
!com.ibm.icu.text,
!org.apache.pdfbox.debugger.*,
sun.java2d.cmm.kcms;resolution:=optional,
picocli;resolution:=optional,
sun.print;resolution:=optional,
*
</Import-Package>
<Embed-Dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public class GeoPdfParserImpl implements GeoPdfParser {
*/
@Override
public String apply(PDDocument pdfDocument) throws IOException {
ToDoubleVisitor toDoubleVisitor = new ToDoubleVisitor();
LinkedList<String> polygons = new LinkedList<>();

for (PDPage pdPage : pdfDocument.getPages()) {
Expand All @@ -82,16 +81,16 @@ public String apply(PDDocument pdfDocument) throws IOException {
if (lgiDictObject instanceof COSArray) {
for (int i = 0; i < ((COSArray) lgiDictObject).size(); i++) {
COSDictionary lgidict =
(COSDictionary) cosObject.getObjectFromPath(LGIDICT + "/[" + i + "]");
(COSDictionary) cosObject.getObjectFromPath(LGIDICT + "/\\[" + i + "\\]");

COSDictionary projectionArray = (COSDictionary) lgidict.getDictionaryObject(PROJECTION);
if (projectionArray != null) {
String projectionType =
((COSString) projectionArray.getItem(PROJECTION_TYPE)).getString();
if (GEOGRAPHIC.equals(projectionType)) {
COSArray neatlineArray =
(COSArray) cosObject.getObjectFromPath(LGIDICT + "/[" + i + "]/" + NEATLINE);
getWktFromNeatLine(lgidict, neatlineArray, toDoubleVisitor).ifPresent(polygons::add);
(COSArray) cosObject.getObjectFromPath(LGIDICT + "/\\[" + i + "\\]/" + NEATLINE);
getWktFromNeatLine(lgidict, neatlineArray).ifPresent(polygons::add);
} else {
LOGGER.debug(
"Unsupported projection type {}. Map Frame will be skipped.", projectionType);
Expand All @@ -114,7 +113,7 @@ public String apply(PDDocument pdfDocument) throws IOException {
neatlineArray = generateNeatLineFromPDFDimensions(pdPage);
}

getWktFromNeatLine(lgidict, neatlineArray, toDoubleVisitor).ifPresent(polygons::add);
getWktFromNeatLine(lgidict, neatlineArray).ifPresent(polygons::add);
} else {
LOGGER.debug(
"Unsupported projection type {}. Map Frame will be skipped.", projectionType);
Expand Down Expand Up @@ -184,30 +183,31 @@ private String point2dToWkt(Point2D point2D) {
*
* @param lgidict - The PDF's LGIDict object
* @param neatLineArray - The NeatLine array of points for the PDF
* @param toDoubleVisitor - A visitor that converts PDF Strings / Ints / Longs into doubles.
* @return the generated WKT Lat/Lon set
* @throws IOException
*/
private Optional<String> getWktFromNeatLine(
COSDictionary lgidict, COSArray neatLineArray, ICOSVisitor toDoubleVisitor)
private Optional<String> getWktFromNeatLine(COSDictionary lgidict, COSArray neatLineArray)
throws IOException {
List<Double> neatline = new LinkedList<>();
List<String> coordinateList = new LinkedList<>();
String firstCoordinate = null;
ToDoubleVisitor toDoubleVisitor = new ToDoubleVisitor();

double[] points = new double[CTM_SIZE];
for (int i = 0; i < CTM_SIZE; i++) {
Object obj = lgidict.getObjectFromPath(CTM + "/[" + i + "]").accept(toDoubleVisitor);
if (obj != null) {
points[i] = (Double) obj;
lgidict.getObjectFromPath(CTM + "/\\[" + i + "\\]").accept(toDoubleVisitor);
Double value = toDoubleVisitor.getDouble();
if (value != null) {
points[i] = value;
} else {
return Optional.empty();
}
}
AffineTransform affineTransform = new AffineTransform(points);

for (int i = 0; i < neatLineArray.size(); i++) {
neatline.add((Double) neatLineArray.get(i).accept(toDoubleVisitor));
neatLineArray.get(i).accept(toDoubleVisitor);
neatline.add(toDoubleVisitor.getDouble());
}

for (int i = 0; i < neatline.size(); i += 2) {
Expand All @@ -234,54 +234,64 @@ private Optional<String> getWktFromNeatLine(
/** This visitor class converts parsable COS Objects into {@link Double}s */
private static class ToDoubleVisitor implements ICOSVisitor {

Double doubleValue = null;

public Double getDouble() {
return doubleValue;
}

@Override
public Object visitFromArray(COSArray cosArray) throws IOException {
return null;
public void visitFromArray(COSArray cosArray) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromBoolean(COSBoolean cosBoolean) throws IOException {
return null;
public void visitFromBoolean(COSBoolean cosBoolean) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromDictionary(COSDictionary cosDictionary) throws IOException {
return null;
public void visitFromDictionary(COSDictionary cosDictionary) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromDocument(COSDocument cosDocument) throws IOException {
return null;
public void visitFromDocument(COSDocument cosDocument) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromFloat(COSFloat cosFloat) throws IOException {
return cosFloat.doubleValue();
public void visitFromFloat(COSFloat cosFloat) throws IOException {
doubleValue = ((Number) (cosFloat.floatValue())).doubleValue();
}

@Override
public Object visitFromInt(COSInteger cosInteger) throws IOException {
return (double) cosInteger.longValue();
public void visitFromInt(COSInteger cosInteger) throws IOException {
doubleValue = (double) cosInteger.longValue();
}

@Override
public Object visitFromName(COSName cosName) throws IOException {
return null;
public void visitFromName(COSName cosName) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromNull(COSNull cosNull) throws IOException {
return null;
public void visitFromNull(COSNull cosNull) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromStream(COSStream cosStream) throws IOException {
return null;
public void visitFromStream(COSStream cosStream) throws IOException {
doubleValue = null;
}

@Override
public Object visitFromString(COSString cosString) throws IOException {
return Double.valueOf(cosString.getString());
public void visitFromString(COSString cosString) throws IOException {
try {
doubleValue = Double.valueOf(cosString.getString());
} catch (NumberFormatException e) {
doubleValue = null;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@

import java.io.IOException;
import java.io.InputStream;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.io.RandomAccessReadBuffer;
import org.apache.pdfbox.pdmodel.PDDocument;

public class PDDocumentGeneratorImpl implements PDDocumentGenerator {
@Override
public PDDocument apply(InputStream inputStream) throws IOException {
return PDDocument.load(inputStream);
return Loader.loadPDF(new RandomAccessReadBuffer(inputStream));
}
}
4 changes: 2 additions & 2 deletions catalog/transformer/catalog-transformer-pptx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncy.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bouncy.version}</version>
</dependency>
<dependency>
Expand Down
6 changes: 0 additions & 6 deletions catalog/transformer/catalog-transformer-tika-input/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@
<artifactId>poi-scratchpad</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<type>pom</type>
<version>${tika.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers-standard-package</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions catalog/transformer/catalog-transformer-video-input/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<type>pom</type>
<artifactId>tika-parsers-standard-package</artifactId>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
Expand Down
6 changes: 3 additions & 3 deletions distribution/kernel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,21 @@
</artifactItem>
<artifactItem>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncy.version}</version>
<outputDirectory>${setup.folder}/jdk9plus</outputDirectory>
<destFileName>bcprov-${bouncy.version}.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<artifactId>bcmail-jdk18on</artifactId>
<version>${bouncy.version}</version>
<outputDirectory>${setup.folder}/jdk9plus</outputDirectory>
<destFileName>bcmail-${bouncy.version}.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bouncy.version}</version>
<outputDirectory>${setup.folder}/jdk9plus</outputDirectory>
<destFileName>bcpkix-${bouncy.version}.jar</destFileName>
Expand Down
6 changes: 4 additions & 2 deletions features/security/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@
<repository>mvn:ddf.features/branding/${project.version}/xml/features</repository>
<repository>mvn:ddf.features/camel-karaf/${project.version}/xml/features</repository>

<feature name="security-core-api-dependencies" version="${project.version"
<feature name="security-core-api-dependencies" version="${project.version}"
description="Dependencies for the core security APIs.">
<!-- Third Party Features -->
<feature prerequisite="true">wrap</feature>
<feature>pax-web-http-whiteboard</feature>
<feature>pax-web-jetty-websockets</feature>
<feature>scr</feature>
<feature version="${spring.feature.version}">spring</feature>

<!-- External DDF Features -->
<feature>jackson</feature>
<feature version="${project.version}">jackson</feature>
<feature>wss4j</feature>
<feature>cxf-ws-security</feature>
<feature>cxf-jaxrs</feature>
Expand All @@ -53,6 +54,7 @@
<!-- Miscellaneous -->
<bundle dependency="true">mvn:org.apache.shiro/shiro-core/${apache.shiro.version}</bundle>
<bundle>mvn:com.sun.mail/jakarta.mail/${jakarta.mail.version}</bundle>
<bundle>mvn:org.apache.commons/commons-text/${commons-text.version}</bundle>
<!--
net.minidev/accessors-smart/1.2 uses asm v5.x. Need this resolved before we can upgrade:
https://bitbucket.org/connect2id/nimbus-jose-jwt/issues/239/switch-to-other-json-library
Expand Down
Loading