- Timestamp:
- May 5, 2015, 5:51:53 PM (9 years ago)
- Branches:
- master
- Children:
- 9ab4eef
- Parents:
- be74e78
- Location:
- murachi
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
murachi/.classpath
rbe74e78 r83a7c4e 26 26 <attributes> 27 27 <attribute name="maven.pomderived" value="true"/> 28 <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> 28 29 </attributes> 29 30 </classpathentry> 30 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/activation-1.1.1.jar"/> 31 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/api-ldap-client-api-1.0.0-M28.jar"/> 32 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/api-ldap-model-1.0.0-M28.jar"/> 33 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/asm-5.0.3.jar"/> 34 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/bcmail-jdk15on-1.51.jar"/> 35 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/bcpkix-jdk15on-1.51.jar"/> 36 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/bcprov-jdk15on-1.51.jar"/> 37 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-cli-1.2.jar"/> 38 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-codec-1.10.jar"/> 39 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-compiler-2.6.1.jar"/> 40 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-compress-1.3.jar"/> 41 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-dbcp2-2.0.1.jar"/> 42 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-io-2.4.jar"/> 43 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-lang-2.6.jar"/> 44 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-logging-1.1.3.jar"/> 45 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/commons-pool2-2.2.jar"/> 46 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/digidoc4j-0.2.9.LOCAL_BUILD.jar"/> 47 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/dss-common-4.3.0-RC.jar"/> 48 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/dss-document-4.3.0-RC.jar"/> 49 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/dss-service-4.3.0-RC.jar"/> 50 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/dss-spi-4.3.0-RC.jar"/> 51 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/fest-assert-1.4.jar"/> 52 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/fest-util-1.2.5.jar"/> 53 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/fontbox-0.1.0.jar"/> 54 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/hamcrest-core-1.3.jar"/> 55 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/hamcrest-library-1.3.jar"/> 56 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/hsqldb-1.8.0.10.jar"/> 57 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/httpclient-4.3.6.jar"/> 58 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/httpcore-4.3.3.jar"/> 59 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jacocoagent.jar"/> 60 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jacocoant.jar"/> 61 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/janino-2.6.1.jar"/> 62 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jaxb-api-2.1.jar"/> 63 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jaxb-impl-2.1.17.jar"/> 64 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jcl-over-slf4j-1.7.7.jar"/> 65 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jdigidoc-3.10.1424.BETA.jar"/> 66 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jempbox-1.8.8.jar"/> 67 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/jul-to-slf4j-1.6.6.jar"/> 68 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/junit-4.11.jar"/> 69 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/log4j-1.2.17.jar"/> 70 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/logback-classic-1.1.3.jar"/> 71 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/logback-core-1.1.3.jar"/> 72 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/mina-core-2.0.9.jar"/> 73 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/mockito-all-1.10.19.jar"/> 74 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/pdfbox-1.8.8.jar"/> 75 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/serializer-2.7.2.jar"/> 76 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/slf4j-api-1.7.12.jar"/> 77 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/snakeyaml-1.14.jar"/> 78 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/stax2-api-3.1.4.jar"/> 79 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/stax-api-1.0.1.jar"/> 80 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/system-rules-1.5.0.jar"/> 81 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/testcerts.jar"/> 82 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/woodstox-core-asl-4.4.1.jar"/> 83 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/xalan-2.7.2.jar"/> 84 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/xercesImpl-2.11.0.jar"/> 85 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/xml-apis-1.4.01.jar"/> 86 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/xmlsec-2.0.3.jar"/> 87 <classpathentry kind="lib" path="/home/aaraujo/desarrollo/2015/servicioVerificacion/src/murachi/murachi/WebContent/WEB-INF/lib/xmlunit-1.5.jar"/> 31 <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> 32 <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> 33 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/activation-1.1.1.jar"/> 34 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/api-ldap-client-api-1.0.0-M28.jar"/> 35 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/api-ldap-model-1.0.0-M28.jar"/> 36 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/asm-5.0.3.jar"/> 37 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/bcmail-jdk15on-1.51.jar"/> 38 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/bcpkix-jdk15on-1.51.jar"/> 39 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/bcprov-jdk15on-1.51.jar"/> 40 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-cli-1.2.jar"/> 41 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-codec-1.10.jar"/> 42 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-compiler-2.6.1.jar"/> 43 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-compress-1.3.jar"/> 44 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-dbcp2-2.0.1.jar"/> 45 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-io-2.4.jar"/> 46 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-lang-2.6.jar"/> 47 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-logging-1.1.3.jar"/> 48 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-pool2-2.2.jar"/> 49 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/digidoc4j-0.2.9.LOCAL_BUILD.jar"/> 50 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/dss-common-4.3.0-RC.jar"/> 51 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/dss-document-4.3.0-RC.jar"/> 52 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/dss-service-4.3.0-RC.jar"/> 53 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/dss-spi-4.3.0-RC.jar"/> 54 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/fest-assert-1.4.jar"/> 55 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/fest-util-1.2.5.jar"/> 56 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/fontbox-0.1.0.jar"/> 57 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/hamcrest-core-1.3.jar"/> 58 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/hamcrest-library-1.3.jar"/> 59 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/hsqldb-1.8.0.10.jar"/> 60 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/httpclient-4.3.6.jar"/> 61 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/httpcore-4.3.3.jar"/> 62 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jacocoagent.jar"/> 63 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jacocoant.jar"/> 64 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/janino-2.6.1.jar"/> 65 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jaxb-api-2.1.jar"/> 66 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jaxb-impl-2.1.17.jar"/> 67 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jcl-over-slf4j-1.7.7.jar"/> 68 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jdigidoc-3.10.1424.BETA.jar"/> 69 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jempbox-1.8.8.jar"/> 70 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jul-to-slf4j-1.6.6.jar"/> 71 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/junit-4.11.jar"/> 72 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/log4j-1.2.17.jar"/> 73 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/logback-classic-1.1.3.jar"/> 74 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/logback-core-1.1.3.jar"/> 75 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/mina-core-2.0.9.jar"/> 76 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/mockito-all-1.10.19.jar"/> 77 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/pdfbox-1.8.8.jar"/> 78 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/serializer-2.7.2.jar"/> 79 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-api-1.7.12.jar"/> 80 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/snakeyaml-1.14.jar"/> 81 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/stax-api-1.0.1.jar"/> 82 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/stax2-api-3.1.4.jar"/> 83 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/system-rules-1.5.0.jar"/> 84 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/testcerts.jar"/> 85 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/woodstox-core-asl-4.4.1.jar"/> 86 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xalan-2.7.2.jar"/> 87 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xercesImpl-2.11.0.jar"/> 88 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xml-apis-1.4.01.jar"/> 89 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xmlsec-2.0.3.jar"/> 90 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xmlunit-1.5.jar"/> 88 91 <classpathentry kind="output" path="target/classes"/> 89 92 </classpath> -
murachi/.project
rbe74e78 r83a7c4e 6 6 </projects> 7 7 <buildSpec> 8 <buildCommand> 9 <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> 10 <arguments> 11 </arguments> 12 </buildCommand> 13 <buildCommand> 14 <name>org.eclipse.wst.common.project.facet.core.builder</name> 15 <arguments> 16 </arguments> 17 </buildCommand> 8 18 <buildCommand> 9 19 <name>org.eclipse.jdt.core.javabuilder</name> … … 16 26 </arguments> 17 27 </buildCommand> 28 <buildCommand> 29 <name>org.eclipse.wst.validation.validationbuilder</name> 30 <arguments> 31 </arguments> 32 </buildCommand> 18 33 </buildSpec> 19 34 <natures> 35 <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 36 <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> 20 37 <nature>org.eclipse.jdt.core.javanature</nature> 21 38 <nature>org.eclipse.m2e.core.maven2Nature</nature> 39 <nature>org.eclipse.wst.common.project.facet.core.nature</nature> 40 <nature>org.eclipse.wst.jsdt.core.jsNature</nature> 22 41 </natures> 23 42 </projectDescription> -
murachi/.settings/org.eclipse.jdt.core.prefs
rbe74e78 r83a7c4e 1 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 3 org.eclipse.jdt.core.compiler.compliance=1.5 2 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 org.eclipse.jdt.core.compiler.compliance=1.7 5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 4 7 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 org.eclipse.jdt.core.compiler.source=1. 58 org.eclipse.jdt.core.compiler.source=1.7 -
murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java
rbe74e78 r83a7c4e 8 8 import java.io.File; 9 9 import java.io.FileInputStream; 10 import java.io.FileNotFoundException;11 10 import java.io.FileOutputStream; 12 11 import java.io.IOException; … … 110 109 import org.digidoc4j.signers.PKCS12Signer; 111 110 112 111 import ve.gob.cenditel.murachi.MurachiException; 113 112 114 113 @Path("/archivos") … … 139 138 * @param fileDetails datos del archivo 140 139 * @return 141 */ 142 /* 140 * @throws MurachiException 141 */ 142 143 143 @POST 144 144 @Path("/") … … 147 147 public Response uploadFile( 148 148 @FormDataParam("upload") InputStream uploadedInputStream, 149 @FormDataParam("upload") FormDataContentDisposition fileDetails) {149 @FormDataParam("upload") FormDataContentDisposition fileDetails) throws MurachiException { 150 150 151 151 //TODO manejar las excepciones correctamente 152 152 if (uploadedInputStream == null) { 153 153 System.out.println("uploadedInputStream == null"); 154 throw new MurachiException("uploadedInputStream != null. datos recibidos del formulario son nulos."); 154 155 } 155 156 156 157 if (fileDetails == null) { 157 158 System.out.println("fileDetails == null"); 159 throw new MurachiException("fileDetails == null. datos recibidos del formulario son nulos."); 158 160 } 159 161 … … 166 168 uploadedInputStream.close(); 167 169 } catch (IOException e) { 168 // TODO Auto-generated catch block169 e.printStackTrace();170 e.printStackTrace(); 171 throw new MurachiException(e.getMessage()); 170 172 } 171 173 … … 178 180 return Response.status(200).entity(result).build(); 179 181 } 180 */ 182 181 183 182 184 /** 183 185 * Carga un archivo pasado a través de un formulario y retorna 184 * un json con el id del archivo en el servidor para futuras consultas 186 * un json con la informacion de la(s) firma(s) del archivo 187 * en caso de que este firmado 185 188 * 186 189 * @param uploadedInputStream stream para obtener el archivo 187 190 * @param fileDetails datos del archivo 188 191 * @return 192 * @throws MurachiException 189 193 */ 190 194 @POST 191 @Path("/ ")195 @Path("/firmados") 192 196 @Consumes(MediaType.MULTIPART_FORM_DATA) 193 197 @Produces(MediaType.APPLICATION_JSON) 194 198 public Response uploadFileAndVerify( 195 199 @FormDataParam("upload") InputStream uploadedInputStream, 196 @FormDataParam("upload") FormDataContentDisposition fileDetails) { 197 198 //TODO manejar las excepciones correctamente 200 @FormDataParam("upload") FormDataContentDisposition fileDetails) throws MurachiException { 201 199 202 if (uploadedInputStream == null) { 200 203 System.out.println("uploadedInputStream == null"); 204 throw new MurachiException("uploadedInputStream != null. datos recibidos del formulario son nulos."); 201 205 } 202 206 203 207 if (fileDetails == null) { 204 208 System.out.println("fileDetails == null"); 209 throw new MurachiException("fileDetails == null. datos recibidos del formulario son nulos."); 205 210 } 206 211 … … 213 218 uploadedInputStream.close(); 214 219 } catch (IOException e) { 215 // TODO Auto-generated catch block216 e.printStackTrace();220 e.printStackTrace(); 221 throw new MurachiException(e.getMessage()); 217 222 } 218 223 … … 231 236 * @param fileDetails 232 237 * @param fileId identificador unico del archivo de acuerdo a UUIDs 233 */ 234 private void saveToDisk(InputStream uploadedInputStream, FormDataContentDisposition fileDetails, String fileId) { 238 * @throws MurachiException 239 */ 240 private void saveToDisk(InputStream uploadedInputStream, FormDataContentDisposition fileDetails, String fileId) throws MurachiException { 235 241 236 242 String uploadedFileLocation = SERVER_UPLOAD_LOCATION_FOLDER + /*fileDetails.getFileName()*/ fileId; … … 253 259 catch(IOException e) { 254 260 e.printStackTrace(); 261 throw new MurachiException(e.getMessage()); 255 262 } 256 263 } … … 262 269 * @param idFile identificador del archivo a verificar 263 270 * @return JSON con informacion de las firmas 271 * @throws MurachiException 264 272 */ 265 273 @GET 266 274 @Path("/{idFile}") 267 275 @Produces("application/json") 268 public Response verifyAFile(@PathParam("idFile") String idFile) {269 276 public Response verifyAFile(@PathParam("idFile") String idFile) throws MurachiException { 277 /* 270 278 System.out.println("/{idFile}"); 271 279 … … 303 311 result = jsonObject.toString(); 304 312 return Response.status(200).entity(result).build(); 305 } 306 307 /** 308 * Verifica si un archivo local posee firmas electronicas y retorna informacion 309 * de las mismas en un json. 310 * 311 * @param idFile identificador del archivo a verificar 312 * @return JSONObject con informacion de las firmas 313 */ 314 public JSONObject verifyALocalFile(String idFile) { 315 316 System.out.println("verifyALocalFile: " + idFile); 313 */ 314 System.out.println("/{idFile}"); 317 315 318 316 String file = SERVER_UPLOAD_LOCATION_FOLDER + idFile; … … 351 349 } 352 350 } 351 String result = jsonObject.toString(); 352 return Response.status(200).entity(result).build(); 353 354 355 } 356 357 /** 358 * Verifica si un archivo local posee firmas electronicas y retorna informacion 359 * de las mismas en un json. 360 * 361 * @param idFile identificador del archivo a verificar 362 * @return JSONObject con informacion de las firmas 363 * @throws MurachiException 364 */ 365 public JSONObject verifyALocalFile(String idFile) throws MurachiException { 366 367 System.out.println("verifyALocalFile: " + idFile); 368 369 String file = SERVER_UPLOAD_LOCATION_FOLDER + idFile; 370 371 File tmpFile = new File(file); 372 373 JSONObject jsonObject = new JSONObject(); 374 375 if (!tmpFile.exists()) { 376 System.out.println("File : " + file + " does not exists."); 377 jsonObject.put("fileExist", "false"); 378 379 }else{ 380 System.out.println("File : " + file + " exists."); 381 jsonObject.put("fileExist", "true"); 382 383 String mime = getMimeType(file); 384 System.out.println("mimetype : " + mime); 385 386 if (mime.equals("application/pdf")){ 387 System.out.println(" PDF "); 388 389 jsonObject = verifySignaturesInPdf(file); 390 391 //}else if (mime.equals("application/vnd.etsi.asic-e+zip")){ 392 }else if (mime.equals("application/zip") ){ 393 System.out.println("BDOC"); 394 //jsonObject.put("formato", "BDOC"); 395 //jsonObject.put("resultado", "NO IMPLEMENTADO"); 396 397 jsonObject = verifySignaturesInBdoc(file); 398 }else{ 399 System.out.println("extension no reconocida"); 400 jsonObject.put("fileExist", "true"); 401 jsonObject.put("error", "extension not supported"); 402 } 403 } 353 404 return jsonObject; 354 405 } … … 359 410 * @param pdfFile archivo pdf a verificar 360 411 * @return JSON con informacion de las firmas del documento PDF 361 */ 362 private JSONObject verifySignaturesInPdf(String pdfFile) { 412 * @throws MurachiException 413 */ 414 private JSONObject verifySignaturesInPdf(String pdfFile) throws MurachiException { 363 415 364 416 JSONObject jsonSignatures = new JSONObject(); … … 397 449 } catch (IOException e) { 398 450 e.printStackTrace(); 451 throw new MurachiException(e.getMessage()); 399 452 } catch (GeneralSecurityException e) { 400 // TODO Auto-generated catch block401 e.printStackTrace();453 e.printStackTrace(); 454 throw new MurachiException(e.getMessage()); 402 455 } 403 456 … … 410 463 * @param name nombre de la firma 411 464 * @return HashMap con campos de informacion de la firma electronica 465 * @throws GeneralSecurityException falla en 466 * @throws IOException cuando ca 412 467 */ 413 468 public HashMap<String, String> verifySignature(AcroFields fields, String name) throws GeneralSecurityException, IOException { … … 1031 1086 System.out.println(" dataFiles: == 0"); 1032 1087 } 1033 1034 1088 1035 1089 jsonSignatures.put("numberOfSignatures", numberOfSignatures); 1036 1090
Note: See TracChangeset
for help on using the changeset viewer.