No problem. Glad to help!
On Wed, Sep 24, 2008 at 4:15 AM, Bakary Dialaya DJIBA <[EMAIL PROTECTED]> wrote:
> It works well.
> Thanks.
>
> On Wed, Sep 24, 2008 at 2:10 AM, James Carman <[EMAIL PROTECTED]>wrote:
>
>> I wouldn't do any downcasting if you want it to be generic. Use the
>> FileObject API:
>>
>> FileObject rootDir = manager.resolveFile("sch:/");
>> FileObject userFolder = rootDir.resolveFile(userName);
>> userFolder.createFolder();
>> FileObject userFile = userFolder.resolveFile("MyFile.txt");
>> userFile.createFile();
>>
>> To get stuff into this "user file", you can use:
>>
>> File localFile = ...;
>> FileObject localFileObject = manager.toFileObject(localFile);
>> FileUtil.copyContent(localFileObject,userFile);
>>
>> On Tue, Sep 23, 2008 at 3:37 PM, Bakary Dialaya DJIBA <[EMAIL PROTECTED]>
>> wrote:
>> > Hi,
>> >
>> > Given a FileSystem *fs* (extends abstractFS) and a FileObject *fo
>> *(extends
>> > AbstractFO), how can I attach the fo to the fs?
>> >
>> > It's a silly question. I am trying to create a provider that I'll add to
>> > the default manager (of VFS). The provider is added successfully but I
>> > cannot make a link between *fs* and *fo*.
>> >
>> > To do this I write the code below:
>> >
>> > DefaultFileSystemManager manager new DefaultFileSystemManager();
>> > MyProvider provider = new MyProvider();
>> > FileSystemOptions fileSystemOptions = new FileSystemOptions();
>> >
>> > manager.addProvider("sch", provider);
>> > manager.init();
>> >
>> > CustomFileObject fo = (CustomFileObject)manager.resolveFile("sch:/");
>> >
>> > CustomFileName fn = new CustomFileName("sch",
>> "userName",FileType.FOLDER);
>> >
>> > CustomFileSystem fs = new CustomFileSystem(fn,fileSystemOptions);
>> > fs.attach(fo);
>> > System.out.println(fo.isAttached()); // return false
>> > fo.doAttach();
>> > System.out.println(fo.isAttached()); // return false
>> >
>> >
>> > My second problème is that I don't know how to set my root file system.
>> And
>> > also fo.getParent() throw a null pointer exception.
>> >
>> > Someone can tell me how to do this:
>> >
>> > FS
>> > |__FileObject1 ...
>> > |
>> > |__FileObject2 ...
>> >
>> > or give me a tutorial to understand VFS API.
>> >
>> > Thanks & Regards.
>> >
>> >
>> > --
>> > Bakary,
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Bakary,
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]