167 |
connect(); |
connect(); |
168 |
} |
} |
169 |
String path = url.getPath(); |
String path = url.getPath(); |
170 |
|
if (path.startsWith("/")) |
171 |
|
{ |
172 |
|
path = path.substring(1); |
173 |
|
} |
174 |
String filename = null; |
String filename = null; |
175 |
int lsi = path.lastIndexOf('/'); |
int lsi = path.lastIndexOf('/'); |
176 |
if (lsi != -1) |
if (lsi != -1) |
202 |
{ |
{ |
203 |
connect(); |
connect(); |
204 |
} |
} |
205 |
String dir = url.getPath(); |
String path = url.getPath(); |
206 |
String filename = url.getFile(); |
if (path.startsWith("/")) |
|
if (!connection.changeWorkingDirectory(dir)) |
|
207 |
{ |
{ |
208 |
throw new FileNotFoundException(dir); |
path = path.substring(1); |
209 |
} |
} |
210 |
if (filename != null) |
String filename = null; |
211 |
|
int lsi = path.lastIndexOf('/'); |
212 |
|
if (lsi != -1) |
213 |
|
{ |
214 |
|
filename = path.substring(lsi + 1); |
215 |
|
path = path.substring(0, lsi); |
216 |
|
if (!connection.changeWorkingDirectory(path)) |
217 |
|
{ |
218 |
|
throw new FileNotFoundException(path); |
219 |
|
} |
220 |
|
} |
221 |
|
if (filename != null && filename.length() > 0) |
222 |
{ |
{ |
223 |
return this.new ClosingOutputStream(connection.store(filename)); |
return this.new ClosingOutputStream(connection.store(filename)); |
224 |
} |
} |