Skip to content

Commit

Permalink
preserve file extension for unknown file types
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 3, 2024
1 parent be4b462 commit 8c03b1f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
Binary file modified j-lawyer-client/lib/j-lawyer-cloud/j-lawyer-cloud.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,21 @@ public static String preserveExtension(String currentFileName, String newFileNam
currentExt = ".pkcs7";
} else if (currentFileName.toLowerCase().endsWith(".ps7s")) {
currentExt = ".p7s";
} else if (currentFileName.toLowerCase().endsWith(".zip")) {
currentExt = ".zip";
}

if("".equals(currentExt)) {
// fallback solution for unkown file types
int dotIndex = currentFileName.lastIndexOf('.');
if (dotIndex > 0 && dotIndex < currentFileName.length() - 1) {
String extension = currentFileName.substring(dotIndex);
if (extension.length() <= 6) {
currentExt = extension;
}
}
}


if (!newFileName.endsWith(currentExt)) {
newFileName = newFileName + currentExt;
Expand Down
2 changes: 1 addition & 1 deletion j-lawyer-server-entities/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ includes=**
j2ee.compile.on.save=true
j2ee.deploy.on.save=false
j2ee.platform=1.6
j2ee.platform.classpath=${j2ee.server.home}/modules/system/layers/base/javax/activation/api/main/activation-1.1.1.jar:${j2ee.server.home}/modules/system/layers/base/javax/annotation/api/main/jboss-annotations-api_1.3_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/batch/api/main/jboss-batch-api_1.0_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ejb/api/main/jboss-ejb-api_3.2_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/el/api/main/jboss-el-api_3.0_spec-1.0.13.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/api/main/cdi-api-2.0.SP1.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/concurrent/api/main/jboss-concurrency-api_1.0_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/faces/api/main/jboss-jsf-api_2.3_spec-2.3.9.SP01.jar:${j2ee.server.home}/modules/system/layers/base/javax/inject/api/main/javax.inject-1.jar:${j2ee.server.home}/modules/system/layers/base/javax/interceptor/api/main/jboss-interceptors-api_1.2_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/jms/api/main/jboss-jms-api_2.0_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/api/main/javax.json-api-1.1.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/bind/api/main/javax.json.bind-api-1.0.jar:${j2ee.server.home}/modules/system/layers/base/javax/jws/api/main/jsr181-api-1.0-MR1.jar:${j2ee.server.home}/modules/system/layers/base/javax/mail/api/main/javax.mail-1.6.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/management/j2ee/api/main/jboss-j2eemgmt-api_1.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/orb/api/main/openjdk-orb-8.1.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/persistence/api/main/javax.persistence-api-2.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/resource/api/main/jboss-connector-api_1.7_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/auth/message/api/main/jboss-jaspi-api_1.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/enterprise/api/main/javax.security.enterprise-api-1.0.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/jacc/api/main/jboss-jacc-api_1.5_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_4.0_spec-1.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jsp/api/main/jboss-jsp-api_2.3_spec-1.0.3.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-compat-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-impl-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-spec-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/transaction/api/main/jboss-transaction-api_1.2_spec-1.1.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/validation/api/main/validation-api-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/websocket/api/main/jboss-websocket-api_1.1_spec-1.1.3.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ws/rs/api/main/jboss-jaxrs-api_2.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/wsdl4j/api/main/wsdl4j-1.6.3.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/bind/api/main/jboss-jaxb-api_2.3_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/rpc/api/main/jboss-jaxrpc-api_1.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/soap/api/main/jboss-saaj-api_1.3_spec-1.0.6.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/ws/api/main/jboss-jaxws-api_2.3_spec-1.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/el/main/javax.el-impl-3.0.1-b08-jbossorg-1.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/enterprise/concurrent/main/javax.enterprise.concurrent-1.0.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/json/main/javax.json-1.1.2.jar
j2ee.platform.classpath=${j2ee.server.home}/modules/system/layers/base/javax/activation/api/main/jakarta.activation-1.2.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/annotation/api/main/jboss-annotations-api_1.3_spec-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/batch/api/main/jboss-batch-api_1.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ejb/api/main/jboss-ejb-api_3.2_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/el/api/main/jboss-el-api_3.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/api/main/jakarta.enterprise.cdi-api-2.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/concurrent/api/main/jboss-concurrency-api_1.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/faces/api/main/jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:${j2ee.server.home}/modules/system/layers/base/javax/inject/api/main/jakarta.inject-api-1.0.5.jar:${j2ee.server.home}/modules/system/layers/base/javax/interceptor/api/main/jboss-interceptors-api_1.2_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/jms/api/main/jboss-jms-api_2.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/api/main/jakarta.json-api-1.1.6.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/bind/api/main/jakarta.json.bind-api-1.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/jws/api/main/jsr181-api-1.0-MR1.jar:${j2ee.server.home}/modules/system/layers/base/javax/mail/api/main/jakarta.mail-1.6.7.jar:${j2ee.server.home}/modules/system/layers/base/javax/management/j2ee/api/main/jboss-j2eemgmt-api_1.1_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/orb/api/main/openjdk-orb-8.1.7.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/persistence/api/main/jakarta.persistence-api-2.2.3.jar:${j2ee.server.home}/modules/system/layers/base/javax/resource/api/main/jboss-connector-api_1.7_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/auth/message/api/main/jboss-jaspi-api_1.1_spec-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/enterprise/api/main/jakarta.security.enterprise-api-1.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/jacc/api/main/jboss-jacc-api_1.5_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_4.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jsp/api/main/jboss-jsp-api_2.3_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-compat-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-impl-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-spec-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/transaction/api/main/jboss-transaction-api_1.3_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/validation/api/main/jakarta.validation-api-2.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/websocket/api/main/jboss-websocket-api_1.1_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ws/rs/api/main/jboss-jaxrs-api_2.1_spec-2.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/wsdl4j/api/main/wsdl4j-1.6.3.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/bind/api/main/jboss-jaxb-api_2.3_spec-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/rpc/api/main/jboss-jaxrpc-api_1.1_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/soap/api/main/jboss-saaj-api_1.4_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/ws/api/main/jboss-jaxws-api_2.3_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/enterprise/concurrent/main/jakarta.enterprise.concurrent-1.1.1.jar
j2ee.server.type=WildFly
jar.compress=false
jar.name=j-lawyer-server-entities.jar
Expand Down
2 changes: 1 addition & 1 deletion j-lawyer-server/j-lawyer-io/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ j2ee.compile.on.save=true
j2ee.copy.static.files.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7
j2ee.platform.classpath=${j2ee.server.home}/modules/system/layers/base/javax/activation/api/main/activation-1.1.1.jar:${j2ee.server.home}/modules/system/layers/base/javax/annotation/api/main/jboss-annotations-api_1.3_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/batch/api/main/jboss-batch-api_1.0_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ejb/api/main/jboss-ejb-api_3.2_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/el/api/main/jboss-el-api_3.0_spec-1.0.13.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/api/main/cdi-api-2.0.SP1.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/concurrent/api/main/jboss-concurrency-api_1.0_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/faces/api/main/jboss-jsf-api_2.3_spec-2.3.9.SP01.jar:${j2ee.server.home}/modules/system/layers/base/javax/inject/api/main/javax.inject-1.jar:${j2ee.server.home}/modules/system/layers/base/javax/interceptor/api/main/jboss-interceptors-api_1.2_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/jms/api/main/jboss-jms-api_2.0_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/api/main/javax.json-api-1.1.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/bind/api/main/javax.json.bind-api-1.0.jar:${j2ee.server.home}/modules/system/layers/base/javax/jws/api/main/jsr181-api-1.0-MR1.jar:${j2ee.server.home}/modules/system/layers/base/javax/mail/api/main/javax.mail-1.6.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/management/j2ee/api/main/jboss-j2eemgmt-api_1.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/orb/api/main/openjdk-orb-8.1.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/persistence/api/main/javax.persistence-api-2.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/resource/api/main/jboss-connector-api_1.7_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/auth/message/api/main/jboss-jaspi-api_1.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/enterprise/api/main/javax.security.enterprise-api-1.0.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/jacc/api/main/jboss-jacc-api_1.5_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_4.0_spec-1.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jsp/api/main/jboss-jsp-api_2.3_spec-1.0.3.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-compat-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-impl-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-spec-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/transaction/api/main/jboss-transaction-api_1.2_spec-1.1.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/validation/api/main/validation-api-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/websocket/api/main/jboss-websocket-api_1.1_spec-1.1.3.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ws/rs/api/main/jboss-jaxrs-api_2.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/wsdl4j/api/main/wsdl4j-1.6.3.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/bind/api/main/jboss-jaxb-api_2.3_spec-1.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/rpc/api/main/jboss-jaxrpc-api_1.1_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/soap/api/main/jboss-saaj-api_1.3_spec-1.0.6.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/ws/api/main/jboss-jaxws-api_2.3_spec-1.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/el/main/javax.el-impl-3.0.1-b08-jbossorg-1.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/enterprise/concurrent/main/javax.enterprise.concurrent-1.0.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/json/main/javax.json-1.1.2.jar
j2ee.platform.classpath=${j2ee.server.home}/modules/system/layers/base/javax/activation/api/main/jakarta.activation-1.2.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/annotation/api/main/jboss-annotations-api_1.3_spec-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/batch/api/main/jboss-batch-api_1.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ejb/api/main/jboss-ejb-api_3.2_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/el/api/main/jboss-el-api_3.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/api/main/jakarta.enterprise.cdi-api-2.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/enterprise/concurrent/api/main/jboss-concurrency-api_1.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/faces/api/main/jboss-jsf-api_2.3_spec-3.1.0.SP01.jar:${j2ee.server.home}/modules/system/layers/base/javax/inject/api/main/jakarta.inject-api-1.0.5.jar:${j2ee.server.home}/modules/system/layers/base/javax/interceptor/api/main/jboss-interceptors-api_1.2_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/jms/api/main/jboss-jms-api_2.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/api/main/jakarta.json-api-1.1.6.jar:${j2ee.server.home}/modules/system/layers/base/javax/json/bind/api/main/jakarta.json.bind-api-1.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/jws/api/main/jsr181-api-1.0-MR1.jar:${j2ee.server.home}/modules/system/layers/base/javax/mail/api/main/jakarta.mail-1.6.7.jar:${j2ee.server.home}/modules/system/layers/base/javax/management/j2ee/api/main/jboss-j2eemgmt-api_1.1_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/orb/api/main/openjdk-orb-8.1.7.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/persistence/api/main/jakarta.persistence-api-2.2.3.jar:${j2ee.server.home}/modules/system/layers/base/javax/resource/api/main/jboss-connector-api_1.7_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/auth/message/api/main/jboss-jaspi-api_1.1_spec-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/enterprise/api/main/jakarta.security.enterprise-api-1.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/security/jacc/api/main/jboss-jacc-api_1.5_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_4.0_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jsp/api/main/jboss-jsp-api_2.3_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-compat-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-impl-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/servlet/jstl/api/main/taglibs-standard-spec-1.2.6-RC1.jar:${j2ee.server.home}/modules/system/layers/base/javax/transaction/api/main/jboss-transaction-api_1.3_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/validation/api/main/jakarta.validation-api-2.0.2.jar:${j2ee.server.home}/modules/system/layers/base/javax/websocket/api/main/jboss-websocket-api_1.1_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/ws/rs/api/main/jboss-jaxrs-api_2.1_spec-2.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/wsdl4j/api/main/wsdl4j-1.6.3.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/bind/api/main/jboss-jaxb-api_2.3_spec-2.0.1.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/rpc/api/main/jboss-jaxrpc-api_1.1_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/soap/api/main/jboss-saaj-api_1.4_spec-1.0.2.Final.jar:${j2ee.server.home}/modules/system/layers/base/javax/xml/ws/api/main/jboss-jaxws-api_2.3_spec-2.0.0.Final.jar:${j2ee.server.home}/modules/system/layers/base/org/glassfish/javax/enterprise/concurrent/main/jakarta.enterprise.concurrent-1.1.1.jar
j2ee.server.type=WildFly
jar.compress=false
javac.classpath=\
Expand Down
Loading

0 comments on commit 8c03b1f

Please sign in to comment.