EldoS | Feel safer!

Software components for data protection, secure storage and transfer

I create folders and files to the Java sample source is required.

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#25719
Posted: 07/18/2013 06:28:56
by Cheolseong Park (Basic support level)
Joined: 07/18/2013
Posts: 2

Hi!

I am using a Java program is testing CallBack File System.
Of the sources in the sample provided Main.java createStorage () function and addMountingPoint (DEFAULT_MOUNT_POINT) function is use for.
However, the sample for folder creation and file creation yet.

Real files exist on the server to a virtual disk in the PC so you can feel free to provide a sample source.
VDisk.cpp are provided for Microsoft Visual Studio is similar to the java code is required.

Thank you for reading.
#25720
Posted: 07/18/2013 08:01:05
by Alexander Plas (EldoS Corp.)

Hello

The provided sample allows you to create new folders and copy any files to the virtual disk in any file manager (Windows Explorer for example).

If you like to create files and directories in your code here is a small example:
Code
final VirtualFile vDir = new VirtualFile( "VirtualDir" );
vDir.setAttributes( FileAttributes.DIRECTORY );
final VirtualFile vFile = new VirtualFile( "VirtualFile" );
vDir.AddFile( vFile );
g_DiskContext.AddFile( vDir );
#25738
Posted: 07/18/2013 19:30:43
by Cheolseong Park (Basic support level)
Joined: 07/18/2013
Posts: 2

Hi Alexander Plas

Thank you for quick response.

I declared g_DiskContext in the code.

Code
DirectoryEnumerationContext g_DiskContext = new DirectoryEnumerationContext();
            
final VirtualFile vDir = new VirtualFile( "VirtualDir" );
vDir.setAttributes( FileAttributes.DIRECTORY );
final VirtualFile vFile = new VirtualFile( "VirtualFile" );
vDir.AddFile( vFile );
g_DiskContext.AddFile( vDir );


As a result, Folder or file was not created yet.

Please check the code is normal.

Thank you for your time.
#25741
Posted: 07/19/2013 00:50:18
by Eugene Mayevski (EldoS Corp.)

Unfortunately it's not possible to say what might go wrong after you add modifications to some place in the code.

Based on your description I suggest that you study the source code of C# Mapper sample. It translates all requests to the underlying file/disk API. As you have real files on the disk and (as I understand it) need to map them to the filesystem, it makes more sense to study that sample rather than try to manipulate with VDisk. VDisk sample is more complicated as it manages objects in memory.

In future we will implement Mapper sample for Java, but this will take some time, so you should not wait for us to do this.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 1129 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!