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.compare.patch
Interface IFilePatch

All Superinterfaces:
IFilePatch2

public interface IFilePatch
extends IFilePatch2

A representation of a file patch that can be applied to an input stream.

Since:
3.3
See Also:
ApplyPatchOperation.parsePatch(org.eclipse.core.resources.IStorage)
Restriction:
This interface is not intended to be implemented by clients. Clients can obtain file patches by calling ApplyPatchOperation.parsePatch(org.eclipse.core.resources.IStorage).

Field Summary
static long DATE_UNKNOWN
          Special constant that will be returned from get getBeforeDate() or getAfterDate() if the date is unknown.
 
Method Summary
  IFilePatchResult apply ( IStorage contents, PatchConfiguration configuration, IProgressMonitor monitor)
          Apply this patch to the given file contents.
 long getAfterDate ()
          Returns the milliseconds time value of the after date from the patch, or DATE_UNKNOWN if the date is unknown.
 long getBeforeDate ()
          Returns the milliseconds time value of the before date from the patch, or DATE_UNKNOWN if the date is unknown.
  String getHeader ()
          Return the header information of the patch or null if there was no header text.
  IPath getTargetPath ( PatchConfiguration configuration)
          Return the target path for this patch.
 
Methods inherited from interface org.eclipse.compare.patch. IFilePatch2
apply, getHunks
 

Field Detail

DATE_UNKNOWN

static final long DATE_UNKNOWN
Special constant that will be returned from get getBeforeDate() or getAfterDate() if the date is unknown. Equal to Midnight, Jan 1, 1970 GMT.

Since:
3.4
See Also:
Constant Field Values
Method Detail

getTargetPath

IPath getTargetPath(
PatchConfiguration configuration)
Return the target path for this patch. The target path may differ depending on whether the patch is being reversed or not.

Specified by:
getTargetPath in interface IFilePatch2
Parameters:
configuration - the patch configuration
Returns:
the target path for this patch
See Also:
PatchConfiguration.isReversed()

apply

IFilePatchResult apply(
IStorage contents,
                       
PatchConfiguration configuration,
                       
IProgressMonitor monitor)
Apply this patch to the given file contents. The result provides the original and patch contents and also indicates whether some portions of the patch (called hunks) failed to apply.

Parameters:
contents - the file contents
configuration - the patch configuration
monitor - a progress monitor
Returns:
the result of the patch application

getHeader

String getHeader()
Return the header information of the patch or null if there was no header text. The header may be multi-line.

Specified by:
getHeader in interface IFilePatch2
Returns:
the header information of the patch or null

getBeforeDate

long getBeforeDate()
Returns the milliseconds time value of the before date from the patch, or DATE_UNKNOWN if the date is unknown.

Specified by:
getBeforeDate in interface IFilePatch2
Returns:
milliseconds time value of the before date from the patch
Since:
3.4

getAfterDate

long getAfterDate()
Returns the milliseconds time value of the after date from the patch, or DATE_UNKNOWN if the date is unknown.

Specified by:
getAfterDate in interface IFilePatch2
Returns:
milliseconds time value of the after date from the patch
Since:
3.4

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