Commits

tbrugz committed d2b0a8c

build cleanup; small changes in CertFileFilter

Comments (0)

Files changed (3)

 	</target>
 
 	<target name="resolve-ivy" description="retrieve dependencies with ivy" depends="prepare">
+		<!-- see: http://ant.apache.org/ivy/history/2.0.0/use/retrieve.html -->
+		
 		<!--ivy:retrieve /-->
 		<ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]"/>
 		<!--ivy:report todir="${dist.dir}" /-->
 	<target name="compile" 
 			depends="prepare"
 			description="Compiles Java files">
-        <javac destdir="${compile.dir}"
-            classpathref="compile.classpath"
-            debug="on"
-            deprecation="off"
-            optimize="off"
-            verbose="false"
-            target="1.5"
-		    >
-	    	<include name="net/sf/pdfsplice/**"/>
-            <src path="${src.dir}"/>
-            <src path="${src.test.dir}"/>
-        </javac>
+		<javac destdir="${compile.dir}"
+			classpathref="compile.classpath"
+			debug="on"
+			deprecation="off"
+			optimize="off"
+			verbose="false"
+			target="1.5">
+			<include name="net/sf/pdfsplice/**"/>
+			<src path="${src.dir}"/>
+			<src path="${src.test.dir}"/>
+		</javac>
 		<copy todir="${compile.dir}" >
 			<fileset dir="${src.dir}" includes="**/*.properties" />
 		</copy>
-    </target>
+	</target>
 	
 	<target name="run" depends="compile">
 		<java classpathref="run.classpath" classname="${manifest.mainclass}" fork="true">
 		</java>
 	</target>
 
-    <target name="jar" depends="compile">
-        <jar jarfile="${dist.dir}/pdfsplice.jar"
-            basedir="${compile.dir}">
-        	<fileset refid="jar.classes"/>
-		    <manifest>
+	<target name="jar" depends="compile">
+		<jar jarfile="${dist.dir}/pdfsplice.jar"
+				basedir="${compile.dir}">
+			<fileset refid="jar.classes"/>
+			<manifest>
 				<attribute name="Manifest-Version" value="${manifest.version}"/>
 				<attribute name="Implementation-Title" value="PDF Splice"/>
 				<attribute name="Implementation-Version" value="${version}"/>
 				<attribute name="Main-Class" value="${manifest.mainclass}"/>
-		    	<attribute name="Class-Path" value="${manifest.classpath}"/>
-		    </manifest>
-        </jar>
-    </target>
+				<attribute name="Class-Path" value="${manifest.classpath}"/>
+			</manifest>
+		</jar>
+	</target>
 	
 	<target name="jar.all-in-one" depends="compile">
 		<jar jarfile="${dist.dir}/pdfsplice.allinone.jar">

src/net/sf/pdfsplice/sign/CertFileFilter.java

 import javax.swing.filechooser.FileFilter;
 
 public class CertFileFilter extends FileFilter {
-	String[] exts = {".ks", ".jks", ".p12", ".cer", ".crt" };
+	String[] exts = {".ks", ".jks", ".p12", ".pfx", ".cer", ".crt" };
 	String desc;
 	
 	{
-		desc = "Arquivos de Certificado (";
+		desc = "Certificate Files (";
 		for(String s: exts) { desc += s+", "; }
+		desc = desc.substring(0, desc.length()-2);
 		desc += ")";
 	}
 	

src_test/net/sf/pdfsplice/test/TestSign.java

 package net.sf.pdfsplice.test;
 
-import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 	
 	@Test
 	public void signJKS() throws Exception {
-		String filename = "eff_comcast_report";
+		String filename = "transparencia brasil - maparisco";
 
 		Signer signer = new Signer();
 		signer.setKeyPath(certdir+"keystore-t.jks");
 		signer.setPass(prop.getProperty("testcert.password").toCharArray());
 		
 		signer.initializeJKS();
-		signer.sign(pdfdirin+filename+".pdf",pdfdirout+filename+"_jks-signed.pdf");
+		try {
+			signer.sign(pdfdirin+filename+".pdf",pdfdirout+filename+"_jks-signed.pdf");
+		}
+		catch(ArrayIndexOutOfBoundsException e) {
+			System.err.println("intermitent ArrayIndexOutOfBoundsException exception occured: "+e);
+			e.printStackTrace();
+		}
 	} 
 
 	@Test