From b6ad34e44b3aedce7134a6bc79cb5b16e1f21617 Mon Sep 17 00:00:00 2001
From: tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>
Date: Wed, 10 Apr 2013 19:35:51 +0000
Subject: Allow to set output filename

git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@403 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
---
 .../java/at/asit/pdfover/gui/composites/OutputComposite.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'pdf-over-gui/src')

diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
index 966a0708..a6f24c9e 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
@@ -218,10 +218,15 @@ public class OutputComposite extends StateComposite {
 		if (!this.saveFailed && outputFolder != null && !outputFolder.trim().isEmpty()) {
 			// Output folder configured, try to save there
 
-			if(!outputFolder.endsWith(File.separator)) {
-				outputFolder += File.separator;
+			File f = new File(outputFolder);
+			if (f.isDirectory()) {
+				if (!outputFolder.endsWith(File.separator)) {
+					outputFolder += File.separator;
+				}
+				outputFileName = outputFolder + proposedName;
+			} else {
+				outputFileName = outputFolder;
 			}
-			outputFileName = outputFolder + proposedName;
 		} else {
 			// Ask user where to save
 
-- 
cgit v1.2.3