 |
Changeset 3345
- Timestamp:
- 03/13/08 03:20:37
(9 months ago)
- Author:
- lmartin92
- Message:
3 classes in FtpFolder? of Tango Vfs is now finished
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3344 |
r3345 |
|
| 29 | 29 | |
|---|
| 30 | 30 | private import tango.net.ftp.FtpClient; |
|---|
| | 31 | |
|---|
| | 32 | //deals with creating null files(what I use it for) |
|---|
| | 33 | private import tango.io.FileConduit; |
|---|
| 31 | 34 | |
|---|
| 32 | 35 | //imports things to deal with text |
|---|
| … | … | |
| 189 | 192 | } |
|---|
| 190 | 193 | else |
|---|
| 191 | | return this; |
|---|
| | 194 | return new FtpFolder(this); |
|---|
| 192 | 195 | } |
|---|
| 193 | 196 | |
|---|
| … | … | |
| 245 | 248 | { |
|---|
| 246 | 249 | _ftp.close(); |
|---|
| 247 | | return this; |
|---|
| | 250 | return new FtpFolder(this); |
|---|
| 248 | 251 | } |
|---|
| 249 | 252 | |
|---|
| … | … | |
| 576 | 579 | VfsFile copy (VfsFile source) |
|---|
| 577 | 580 | { |
|---|
| 578 | | return null; |
|---|
| | 581 | InputStream istream = source.input; |
|---|
| | 582 | this.create(); |
|---|
| | 583 | OutputStream os = this.output; |
|---|
| | 584 | void[] dest; |
|---|
| | 585 | istream.read(dest); |
|---|
| | 586 | os.write(dest); |
|---|
| | 587 | return new FtpFile(this, _toString); |
|---|
| 579 | 588 | } |
|---|
| 580 | 589 | |
|---|
| … | … | |
| 587 | 596 | VfsFile move (VfsFile source) |
|---|
| 588 | 597 | { |
|---|
| 589 | | return null; |
|---|
| | 598 | copy(source); |
|---|
| | 599 | source.remove(); |
|---|
| | 600 | return new FtpFile(this, _toString); |
|---|
| 590 | 601 | } |
|---|
| 591 | 602 | |
|---|
| … | … | |
| 599 | 610 | { |
|---|
| 600 | 611 | _folder._ftp.del(this.toString); |
|---|
| 601 | | return create(null); //needs to replace null with an empty stream |
|---|
| | 612 | FileConduit.Style style; |
|---|
| | 613 | style.access = FileConduit.Access.ReadWrite; |
|---|
| | 614 | style.cache = FileConduit.Cache.None; |
|---|
| | 615 | style.open = FileConduit.Open.Create; |
|---|
| | 616 | style.share = FileConduit.Share.None; |
|---|
| | 617 | FilePath mfp = new FilePath(""); |
|---|
| | 618 | mfp.set(mfp.root ~ "//NF"); |
|---|
| | 619 | FileConduit fs = new FileConduit(mfp, style); |
|---|
| | 620 | byte[] src; |
|---|
| | 621 | src ~= cast(byte)1; |
|---|
| | 622 | src ~= cast(byte)1; |
|---|
| | 623 | fs.write(src); |
|---|
| | 624 | return create(fs); //needs to replace null with an empty stream |
|---|
| 602 | 625 | } |
|---|
| 603 | 626 | |
|---|
| … | … | |
| 636 | 659 | InputStream input () |
|---|
| 637 | 660 | { |
|---|
| 638 | | return null; |
|---|
| | 661 | InputStream istream = _folder._ftp.input; |
|---|
| | 662 | prepareInputStream(_folder._ftp, istream, FtpCommand.RETR, ["", _toString]); |
|---|
| | 663 | return istream; |
|---|
| 639 | 664 | } |
|---|
| 640 | 665 | |
|---|
| … | … | |
| 648 | 673 | OutputStream output () |
|---|
| 649 | 674 | { |
|---|
| 650 | | return null; |
|---|
| 651 | | } |
|---|
| 652 | | |
|---|
| 653 | | /*********************************************************************** |
|---|
| 654 | | |
|---|
| 655 | | Duplicate this entry |
|---|
| | 675 | OutputStream os = _folder._ftp.output; |
|---|
| | 676 | prepareOutputStream(_folder._ftp, os, FtpCommand.STOR, ["", _toString]); |
|---|
| | 677 | return os; |
|---|
| | 678 | } |
|---|
| | 679 | |
|---|
| | 680 | /*********************************************************************** |
|---|
| | 681 | |
|---|
| | 682 | Returns a copy of this instance; |
|---|
| | 683 | Does not copy file. |
|---|
| 656 | 684 | |
|---|
| 657 | 685 | ***********************************************************************/ |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic