bug fix. Local write() should create parent directories just like remote write().

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1773 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-01-15 23:48:38 +00:00
1 parent 161b951b6d
commit 9dfd5b8200
1 file changed
+5 -2
+5 -2
View File
@@ -439,8 +439,11 @@ public final class FilePath implements Serializable {
* If the directory doesn't exist, it will be created.
*/
public OutputStream write() throws IOException, InterruptedException {
if(channel==null)
return new FileOutputStream(new File(remote));
if(channel==null) {
File f = new File(remote);
f.getParentFile().mkdirs();
return new FileOutputStream(f);
}
return channel.call(new Callable<OutputStream,IOException>() {
public OutputStream call() throws IOException {