org.eclipse.emf.emfstore.internal.client.model.filetransfer
Class FileInformation

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.filetransfer.FileInformation

public class FileInformation
extends Object

This is a facade class to execute different actions and queries on files that a project space has. An instance of this class is retrieved by calling ProjectSpace.getFileInfo( FileIdentifier ). It can be used to access or alter different aspects of the file wih the given identifier. If the file API is to be extended in the future, do this by adding methods to this class instead of adding them to the project space directly. This way the (already huge) interface of the ProjectSpace is kept slim.

Author:
jfinis

Method Summary
 void cancelPendingUpload()
          Cancels a pending upload.
 boolean isCached()
          Returns true if the file is cached locally.
 boolean isPendingUpload()
          Returns true if this file was recently added but not yet commited.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isCached

public boolean isCached()
Returns true if the file is cached locally. If this method returns true, the getFile method will succeed even if no connection to the server exists.

Returns:
true, iff the file is cached locally

isPendingUpload

public boolean isPendingUpload()
Returns true if this file was recently added but not yet commited. This means that it is a "pending upload", i.e. a file that waits in the cache for being uploaded to the EMF Store. The specialty about such a file is that it can be removed, since it is not saved at the server yet. You can use the cancelPendingUpload() method to remove such a file.

Returns:
iff this file is a pending upload

cancelPendingUpload

public void cancelPendingUpload()
Cancels a pending upload. This means that the pending upload is removed from the upload queue and deleted from cache. If the upload is not pending, then this method does nothing.



Copyright © 2015. All Rights Reserved.