[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [platform-core-dev] Creating new file without using java.io.File
 | 
Thanks a lot. That worked :)
________________________________
From: platform-core-dev-bounces@xxxxxxxxxxx [platform-core-dev-bounces@xxxxxxxxxxx] on behalf of John Arthorne [John_Arthorne@xxxxxxxxxx]
Sent: Friday, March 22, 2013 4:58 PM
To: Eclipse Platform Core component developers list.
Subject: Re: [platform-core-dev] Creating new file without using java.io.File
You can create a new empty file by opening an output stream and then immediately close it. I.e., fs.openOutputStream(...).close();
John
From:        "Grigoropol, IoanaX" <ioanax.grigoropol@xxxxxxxxx>
To:        "platform-core-dev@xxxxxxxxxxx" <platform-core-dev@xxxxxxxxxxx>,
Date:        03/22/2013 10:28 AM
Subject:        [platform-core-dev] Creating new file without using java.io.File
Sent by:        platform-core-dev-bounces@xxxxxxxxxxx
________________________________
Hello,
I am trying to abstractive a remote file store implementation and I am stuck in the following scenario:
           IFileStore fs = EFS.getStore(uri);
           fs = fs.getFileStore(relPath);
           IFileInfo f = fs.fetchInfo();
           if (!f.exists()){
                // create this file
           }
Is there a way of creating a new file without using java.io.File.createNewFile() ?  This fails in my case since the URI that this file was created on is not a local one (does not start with "file://").
Are there any recommended ways of creating a new file just by using the interfaces IFileInfo and/ord IFileStore (eg. fileStore.createNewFile() method)?
Thank you,
Ioana Grigoropol
_______________________________________________
platform-core-dev mailing list
platform-core-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-core-dev