diff options
Diffstat (limited to 'pki/base/java-tools/src/com/netscape/cmstools/BtoA.java')
-rw-r--r-- | pki/base/java-tools/src/com/netscape/cmstools/BtoA.java | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/pki/base/java-tools/src/com/netscape/cmstools/BtoA.java b/pki/base/java-tools/src/com/netscape/cmstools/BtoA.java index 2bc96a2fd..3d281d0cc 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/BtoA.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/BtoA.java @@ -17,49 +17,48 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cmstools; - import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; - /** * The BtoA class is a utility program designed to "translate" a BINARY - * BASE 64 encoded blob into an ASCII BASE 64 encoded blob. It assumes + * BASE 64 encoded blob into an ASCII BASE 64 encoded blob. It assumes * that the name of a data file is passed to the program via the command line, * and that the contents contain a blob encoded in a BINARY BASE 64 * format. - * + * * <P> * The program may be invoked as follows: + * * <PRE> - * + * * BtoA <input filename> <output filename> - * + * * NOTE: <input filename> must contain a BINARY * BASE 64 encoded blob - * + * * <output filename> contains an ASCII * BASE 64 encoded blob * </PRE> - * + * * @version $Revision$, $Date$ */ public class BtoA { // Define constants - public static final int ARGC = 2; + public static final int ARGC = 2; public static void main(String argv[]) { - FileInputStream inputBlob = null; + FileInputStream inputBlob = null; FileOutputStream outputBlob = null; // (1) Check that two arguments were submitted to the program if (argv.length != ARGC) { System.out.println("Usage: BtoA " + - "<input filename> " + - "<output filename>"); + "<input filename> " + + "<output filename>"); return; } @@ -70,7 +69,7 @@ public class BtoA { inputBlob = new FileInputStream(argv[0]); } catch (FileNotFoundException e) { System.out.println("BtoA(): can''t find file " + - argv[0] + ":\n" + e); + argv[0] + ":\n" + e); return; } @@ -80,7 +79,7 @@ public class BtoA { outputBlob = new FileOutputStream(argv[1]); } catch (IOException e) { System.out.println("BtoA(): unable to open file " + - argv[1] + " for writing:\n" + e); + argv[1] + " for writing:\n" + e); return; } @@ -93,8 +92,8 @@ public class BtoA { outputBlob.write(out.getBytes()); } catch (IOException e) { System.out.println("BtoA(): Unexpected BASE64 " + - "encoded error encountered:\n" + - e); + "encoded error encountered:\n" + + e); } // (5) Close the DataInputStream() object @@ -102,8 +101,8 @@ public class BtoA { inputBlob.close(); } catch (IOException e) { System.out.println("BtoA(): Unexpected input error " + - "encountered while attempting to close() " + - argv[0] + ":\n" + e); + "encountered while attempting to close() " + + argv[0] + ":\n" + e); } // (6) Close the FileOutputStream() object @@ -111,9 +110,8 @@ public class BtoA { outputBlob.close(); } catch (IOException e) { System.out.println("BtoA(): Unexpected output error " + - "encountered while attempting to close() " + - argv[1] + ":\n" + e); + "encountered while attempting to close() " + + argv[1] + ":\n" + e); } } } - |