|
From: SVN by r. <sv...@ca...> - 2008-01-14 11:10:05
|
Author: roy
Date: 2008-01-14 11:57:59 +0100 (Mon, 14 Jan 2008)
New Revision: 221
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
Log:
fix spool with ~ in filename
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2008-01-14 10:46:32 UTC (rev 220)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2008-01-14 10:57:59 UTC (rev 221)
@@ -137,6 +137,7 @@
output("Type 'help' to get a list of available commands other then the default sql input.");
}
+
/**
* Returns the connection to the database
* @return the connection to the database
@@ -1094,16 +1095,16 @@
}
} else {
try {
- File f = new File(toFileName(nextPart));
+ File f = new File(toFileName(nextPart.trim()));
fileName = f.getAbsolutePath();
if ((f.exists() && !f.canWrite()) || (!f.exists() && !f.createNewFile())) {
throw new IllegalStateException("Failed to create spool to file: '"+fileName+"'");
}
- spoolWriter = new FileWriter(nextPart);
+ spoolWriter = new FileWriter(fileName);
} catch (IOException e) {
- throw new IllegalStateException("Failed to create spool: " + e.toString(), e);
+ throw new IllegalStateException("Failed to create spool ("+fileName+"): " + e.toString(), e);
}
- return "Spool created.";
+ return "Spool to "+fileName+" created.";
}
}
|