 |
Changeset 3382
- Timestamp:
- 03/19/08 02:12:22
(9 months ago)
- Author:
- lmartin92
- Message:
Fixed up a little. Now all is completed but FtpFiles?. I will work a little on this Saturday.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3377 |
r3382 |
|
| 17 | 17 | |
|---|
| 18 | 18 | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| 19 | | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| | 19 | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| 20 | 20 | in { |
|---|
| 21 | 21 | assert(server != ""); |
|---|
| … | … | |
| 71 | 71 | |
|---|
| 72 | 72 | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| 73 | | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| | 73 | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| 74 | 74 | in { |
|---|
| 75 | 75 | assert(server != ""); |
|---|
| … | … | |
| 104 | 104 | VfsFolders self() { |
|---|
| 105 | 105 | return new VfsFolders(toString_, name_, username_, password_, port_, |
|---|
| 106 | | true); |
|---|
| | 106 | true); |
|---|
| 107 | 107 | } |
|---|
| 108 | 108 | |
|---|
| 109 | 109 | VfsFolders tree() { |
|---|
| 110 | 110 | return new VfsFolders(toString_, name_, username_, password_, port_, |
|---|
| 111 | | false); |
|---|
| | 111 | false); |
|---|
| 112 | 112 | } |
|---|
| 113 | 113 | |
|---|
| … | … | |
| 123 | 123 | if(fi.type = FtpFileType.dir) { |
|---|
| 124 | 124 | FtpFolder x = new FtpFolder(toString_, fi.name, username_, |
|---|
| 125 | | password_, port_); |
|---|
| | 125 | password_, port_); |
|---|
| 126 | 126 | if((result = dg(x)) != 0) |
|---|
| 127 | 127 | break; |
|---|
| … | … | |
| 178 | 178 | |
|---|
| 179 | 179 | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| 180 | | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| | 180 | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| 181 | 181 | in { |
|---|
| 182 | 182 | assert(server != ""); |
|---|
| … | … | |
| 195 | 195 | int opApply(int delegate(inout VfsFolder) dg) { |
|---|
| 196 | 196 | FtpFolder ftp = new FtpFolder(toString_, name_, username, password_, |
|---|
| 197 | | port_); |
|---|
| | 197 | port_); |
|---|
| 198 | 198 | ftp.opApply(dg); |
|---|
| 199 | 199 | } |
|---|
| … | … | |
| 250 | 250 | VfsFiles catalog(char[] pattern) { |
|---|
| 251 | 251 | return new FtpFiles(toString_, name_, username_, password_, port_, |
|---|
| 252 | | pattern); |
|---|
| | 252 | pattern); |
|---|
| 253 | 253 | } |
|---|
| 254 | 254 | |
|---|
| 255 | 255 | VfsFiles catalog(VfsFilter filter = null) { |
|---|
| 256 | 256 | return new FtpFiles(toString_, name_, username_, password_, port_, |
|---|
| 257 | | filter); |
|---|
| | 257 | filter); |
|---|
| 258 | 258 | } |
|---|
| 259 | 259 | } |
|---|
| … | … | |
| 267 | 267 | |
|---|
| 268 | 268 | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| 269 | | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| | 269 | char[] password = "anonymous@anonymous", uint port = 21) |
|---|
| 270 | 270 | in { |
|---|
| 271 | 271 | assert(server != ""); |
|---|
| … | … | |
| 310 | 310 | |
|---|
| 311 | 311 | VfsFile copy(VfsFile source) { |
|---|
| 312 | | return null; |
|---|
| | 312 | output.write(source.input.read); |
|---|
| 313 | 313 | } |
|---|
| 314 | 314 | |
|---|
| 315 | 315 | VfsFile move(VfsFile source) { |
|---|
| 316 | | return null; |
|---|
| | 316 | copy(source); |
|---|
| | 317 | source.remove; |
|---|
| 317 | 318 | } |
|---|
| 318 | 319 | |
|---|
| 319 | 320 | VfsFile create() { |
|---|
| 320 | | return null; |
|---|
| | 321 | FileFolder ff = new FileFolder("/NF", true); |
|---|
| | 322 | ftp_ = new FTPConnection(); |
|---|
| | 323 | ftp_.connect(toString_, username_, password_, port_); |
|---|
| | 324 | ftp_.put(name_, ff.input); |
|---|
| | 325 | ftp.close(); |
|---|
| | 326 | ff.remove(); |
|---|
| | 327 | return new FtpFile(toString_, name_, username_, password_, port_); |
|---|
| 321 | 328 | } |
|---|
| 322 | 329 | |
|---|
| 323 | 330 | VfsFile create(InputStream stream) { |
|---|
| 324 | | return null; |
|---|
| | 331 | ftp_ = new FTPConnection(); |
|---|
| | 332 | ftp_.connect(toString_, username_, password_, port_); |
|---|
| | 333 | ftp_.put(name_, stream); |
|---|
| | 334 | ftp.close(); |
|---|
| | 335 | return new FtpFile(toString_, name_, username_, password_, port_); |
|---|
| 325 | 336 | } |
|---|
| 326 | 337 | |
|---|
| 327 | 338 | VfsFile remove() { |
|---|
| 328 | | return null; |
|---|
| | 339 | ftp_ = new FTPConnection(); |
|---|
| | 340 | ftp_.connect(toString_, username_, password_, port_); |
|---|
| | 341 | ftp_.del(name_); |
|---|
| | 342 | return new VfsFile(toString_, name_, username_, password_, port_); |
|---|
| 329 | 343 | } |
|---|
| 330 | 344 | |
|---|
| 331 | 345 | InputStream input() { |
|---|
| 332 | | return null; |
|---|
| | 346 | ftp_ = new FtpConnection(); |
|---|
| | 347 | ftp_.connect(toString_, username_, password_, port_); |
|---|
| | 348 | InputStream input = ftp_.input; |
|---|
| | 349 | prepareInputStream(ftp_, input, FtpCommand.RETR, ["", path_]); |
|---|
| | 350 | ftp_.close(); |
|---|
| | 351 | return input; |
|---|
| 333 | 352 | } |
|---|
| 334 | 353 | |
|---|
| 335 | 354 | OutputStream output() { |
|---|
| 336 | | return null; |
|---|
| | 355 | ftp_ = new FtpConnection(); |
|---|
| | 356 | ftp_.connect(toString_, username_, password_, port_); |
|---|
| | 357 | OutputStream output = ftp_.output; |
|---|
| | 358 | prepareOutputStream(ftp_, output, FtpCommand.STOR, ["", path_]); |
|---|
| | 359 | ftp_.close(); |
|---|
| | 360 | return output; |
|---|
| 337 | 361 | } |
|---|
| 338 | 362 | |
|---|
| 339 | 363 | VfsFile dup() { |
|---|
| 340 | | return null; |
|---|
| | 364 | return new FtpFile(toString_, name_, username_, password_, port_); |
|---|
| 341 | 365 | } |
|---|
| 342 | 366 | } |
|---|
| … | … | |
| 350 | 374 | char[] filter_; |
|---|
| 351 | 375 | VfsFilter ffilter_; |
|---|
| 352 | | bool useFilter = false; |
|---|
| 353 | | |
|---|
| 354 | | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| 355 | | char[] password = "anonymous@anonymous", uint port = 21, |
|---|
| 356 | | char[] filtPattern = "") |
|---|
| | 376 | bool useFilter_ = false; |
|---|
| | 377 | |
|---|
| | 378 | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| | 379 | char[] password = "anonymous@anonymous", uint port = 21, |
|---|
| | 380 | char[] filtPattern = "") |
|---|
| 357 | 381 | in { |
|---|
| 358 | 382 | assert(server != ""); |
|---|
| … | … | |
| 368 | 392 | port_ = port; |
|---|
| 369 | 393 | filter_ = filtPattern; |
|---|
| 370 | | useFilter = true; |
|---|
| 371 | | } |
|---|
| 372 | | |
|---|
| 373 | | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| 374 | | char[] password = "anonymous@anonymous", uint port = 21, |
|---|
| 375 | | VfsFilter filter = null) |
|---|
| | 394 | useFilter_ = true; |
|---|
| | 395 | } |
|---|
| | 396 | |
|---|
| | 397 | public this(char[] server, char[] path, char[] username = "anonymous", |
|---|
| | 398 | char[] password = "anonymous@anonymous", uint port = 21, |
|---|
| | 399 | VfsFilter filter = null) |
|---|
| 376 | 400 | in { |
|---|
| 377 | 401 | assert(server != ""); |
|---|
Download in other formats:
|
 |