diff options
Diffstat (limited to 'pdf-over-gui/src/main/java')
4 files changed, 24 insertions, 23 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Unzipper.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Unzipper.java index bd695bce..1c638f0d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Unzipper.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Unzipper.java @@ -54,7 +54,7 @@ public class Unzipper { if (entry.isDirectory()) { log.debug("Extracting directory: " + entry.getName()); //$NON-NLS-1$ - File nDir =new File(targetPath + "/" + entry.getName()); //$NON-NLS-1$ + File nDir = new File(targetPath + File.separator + entry.getName()); if(!nDir.exists()) { if(!nDir.mkdir()) { throw new IOException("Failed to create dir: " + entry.getName()); //$NON-NLS-1$ @@ -65,7 +65,7 @@ public class Unzipper { byte[] buffer = new byte[1024]; int len; BufferedOutputStream out = new BufferedOutputStream( - new FileOutputStream(targetPath + "/" + entry.getName())); //$NON-NLS-1$ + new FileOutputStream(targetPath + File.separator + entry.getName())); while ((len = zis.read(buffer)) >= 0) out.write(buffer, 0, len); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java index 55df1b57..93aaead2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java @@ -342,7 +342,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator { String filename = this.getConfigurationFile(); File configFile = new File(this.getConfigurationDirectory() - + "/" + filename); //$NON-NLS-1$ + + File.separator + filename); Properties props = new Properties(); props.clear(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java index c06d04de..4d2b75f5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java @@ -52,7 +52,7 @@ public class OutputState extends State { ConfigProvider config = this.stateMachine.getConfigProvider(); Status status = this.stateMachine.getStatus(); - File tmpDir = new File(config.getConfigurationDirectory() + "/tmp"); //$NON-NLS-1$ + File tmpDir = new File(config.getConfigurationDirectory() + File.separator + "tmp"); //$NON-NLS-1$ if(!tmpDir.exists()) { tmpDir.mkdir(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index 152a7c38..e9f75539 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -53,7 +53,18 @@ import at.asit.pdfover.signator.Signator; */ public class PrepareConfigurationState extends State { - + /** SFL4J Logger instance **/ + private static final Logger log = LoggerFactory + .getLogger(PrepareConfigurationState.class); + + private static String RES_SEPARATOR = "/"; //$NON-NLS-1$ + + private static String FILE_SEPARATOR = File.separator; + + private ArgumentHandler handler; + + private ArgumentHandler configFilehandler; + /** * @param stateMachine */ @@ -76,16 +87,6 @@ public class PrepareConfigurationState extends State { this.configFilehandler.addCLIArgument(new ConfigFileArgument()); } - private ArgumentHandler handler; - - private ArgumentHandler configFilehandler; - - /** - * SFL4J Logger instance - **/ - private static final Logger log = LoggerFactory - .getLogger(PrepareConfigurationState.class); - private void initializeFromConfigurationFile(String filename) throws InitializationException { try { @@ -93,7 +94,7 @@ public class PrepareConfigurationState extends State { try { this.stateMachine.getConfigProvider().loadConfiguration( new FileInputStream( - this.stateMachine.getConfigProvider().getConfigurationDirectory() + "/" + filename)); //$NON-NLS-1$ + this.stateMachine.getConfigProvider().getConfigurationDirectory() + FILE_SEPARATOR + filename)); log.info("Loaded config from file : " + filename); //$NON-NLS-1$ @@ -103,7 +104,7 @@ public class PrepareConfigurationState extends State { // default value! try { InputStream is = this.getClass().getResourceAsStream( - "/" + filename); //$NON-NLS-1$ + RES_SEPARATOR + filename); this.stateMachine.getConfigProvider() .loadConfiguration(is); @@ -137,8 +138,8 @@ public class PrepareConfigurationState extends State { try { File configDir = new File(this.stateMachine.getConfigProvider().getConfigurationDirectory()); - File configFile = new File(this.stateMachine.getConfigProvider().getConfigurationDirectory() + "/" //$NON-NLS-1$ - + Constants.DEFAULT_CONFIG_FILENAME); + File configFile = new File(this.stateMachine.getConfigProvider().getConfigurationDirectory() + + FILE_SEPARATOR + Constants.DEFAULT_CONFIG_FILENAME); if (!configDir.exists() || !configFile.exists()) { boolean allOK = false; @@ -158,9 +159,9 @@ public class PrepareConfigurationState extends State { FileOutputStream pdfOverConfig = null; try { inputStream = this.getClass().getResourceAsStream( - "/" + Constants.DEFAULT_CONFIG_FILENAME); //$NON-NLS-1$ + RES_SEPARATOR + Constants.DEFAULT_CONFIG_FILENAME); pdfOverConfig = new FileOutputStream(this.stateMachine.getConfigProvider().getConfigurationDirectory() - + "/" + Constants.DEFAULT_CONFIG_FILENAME); //$NON-NLS-1$ + + FILE_SEPARATOR + Constants.DEFAULT_CONFIG_FILENAME); while ((byteCount = inputStream.read(buffer)) >= 0) { pdfOverConfig.write(buffer, 0, byteCount); @@ -195,9 +196,9 @@ public class PrepareConfigurationState extends State { pdfOverConfig = null; try { inputStream = this.getClass().getResourceAsStream( - "/" + Constants.DEFAULT_LOG4J_FILENAME); //$NON-NLS-1$ + RES_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME); pdfOverConfig = new FileOutputStream(this.stateMachine.getConfigProvider().getConfigurationDirectory() - + "/" + Constants.DEFAULT_LOG4J_FILENAME); //$NON-NLS-1$ + + FILE_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME); while ((byteCount = inputStream.read(buffer)) >= 0) { pdfOverConfig.write(buffer, 0, byteCount); |