Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.resources
Interface IFileState

All Superinterfaces:
IAdaptable, IEncodedStorage, IStorage

public interface IFileState
extends IEncodedStorage, IAdaptable

A previous state of a file stored in the workspace's local history.

Certain methods for updating, deleting, or moving a file cause the "before" contents of the file to be copied to an internal area of the workspace called the local history area thus providing a limited history of earlier states of a file.

Moving or copying a file will cause a copy of its local history to appear at the new location as well as at the original location. Subsequent changes to either file will only affect the local history of the file changed. Deleting a file and creating another one at the same path does not affect the history. If the original file had history, that same history will be available for the new one.

The local history does not track resource properties. File states are volatile; the platform does not guarantee that a certain state will always be in the local history.

File state objects implement the IAdaptable interface; extensions are managed by the platform's adapter manager.

See Also:
IFile, IStorage, Platform.getAdapterManager()
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.

Method Summary
 boolean exists ()
          Returns whether this file state still exists in the local history.
  InputStream getContents ()
          Returns an open input stream on the contents of this file state.
  IPath getFullPath ()
          Returns the full path of this file state.
 long getModificationTime ()
          Returns the modification time of the file.
  String getName ()
          Returns the name of this file state.
 boolean isReadOnly ()
          Returns whether this file state is read-only.
 
Methods inherited from interface org.eclipse.core.resources. IEncodedStorage
getCharset
 
Methods inherited from interface org.eclipse.core.runtime. IAdaptable
getAdapter
 

Method Detail

exists

boolean exists()
Returns whether this file state still exists in the local history.

Returns:
true if this state exists, and false if it does not

getContents

InputStream getContents()
                        throws 
CoreException
Returns an open input stream on the contents of this file state. This refinement of the corresponding IStorage method returns an open input stream on the contents this file state represents. The client is responsible for closing the stream when finished.

Specified by:
getContents in interface IStorage
Returns:
an input stream containing the contents of the file
Throws:
CoreException - if this method fails. Reasons include:
  • This state does not exist.

getFullPath

IPath getFullPath()
Returns the full path of this file state. This refinement of the corresponding IStorage method specifies that IFileStates always have a path and that path is the full workspace path of the file represented by this state.

Specified by:
getFullPath in interface IStorage
Returns:
the path related to the data represented by this storage or null if none.
See Also:
IResource.getFullPath(), IStorage.getFullPath()

getModificationTime

long getModificationTime()
Returns the modification time of the file. If you create a file at 9:00 and modify it at 11:00, the file state added to the history at 11:00 will have 9:00 as its modification time.

Note that is used only to give the user a general idea of how old this file state is.

Returns:
the time of last modification, in milliseconds since January 1, 1970, 00:00:00 GMT.

getName

String getName()
Returns the name of this file state. This refinement of the corresponding IStorage method specifies that IFileStates always have a name and that name is equivalent to the last segment of the full path of the resource represented by this state.

Specified by:
getName in interface IStorage
Returns:
the name of the data represented by this storage, or null if this storage has no name
See Also:
IResource.getName(), IStorage.getName()

isReadOnly

boolean isReadOnly()
Returns whether this file state is read-only. This refinement of the corresponding IStorage method restricts IFileStates to always be read-only.

Specified by:
isReadOnly in interface IStorage
Returns:
true if this storage is read-only
See Also:
IStorage

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire