Drools :: Eclipse :: Guvnor tools 6.1.0.Beta3

org.guvnor.tools.utils
Class GuvnorMetadataUtils

java.lang.Object
  extended by org.guvnor.tools.utils.GuvnorMetadataUtils

public class GuvnorMetadataUtils
extends Object

A set of utilities for dealing with (local) Guvnor metadata.


Constructor Summary
GuvnorMetadataUtils()
           
 
Method Summary
static boolean addResourceToGuvnor(String repLoc, String targetLoc, org.eclipse.core.resources.IFile selectedFile)
          Adds a resource to Guvnor.
static void commitFileChanges(org.eclipse.core.resources.IFile selectedFile)
          Commits changes to Guvnor.
static org.eclipse.core.runtime.IPath createGuvnorMetadataLocation(String rootPath)
           
static org.eclipse.core.resources.IFile findGuvnorMetadata(org.eclipse.core.runtime.IPath resource)
          Finds the local Guvnor metadata file associated with a given resource.
static org.eclipse.core.resources.IFile findGuvnorMetadata(org.eclipse.core.resources.IResource resource)
          Finds the local Guvnor metadata file associated with a given resource.
static org.eclipse.core.resources.IFile getGuvnorControlledResource(org.eclipse.core.resources.IResource resource)
           
static GuvnorMetadataProps getGuvnorMetadata(org.eclipse.core.resources.IResource resource)
           
static File getGuvnorMetadataFile(String path, String fname)
           
static String getGuvnorResourceProperty(org.eclipse.core.resources.IResource resource)
           
static boolean isGuvnorControlledResource(org.eclipse.core.resources.IResource resource)
           
static boolean isGuvnorMetadata(org.eclipse.core.resources.IResource resource)
           
static boolean isGuvnorResourceCurrent(org.eclipse.core.resources.IResource resource)
           
static GuvnorMetadataProps loadGuvnorMetadata(org.eclipse.core.resources.IFile mdFile)
           
static void markCurrentGuvnorResource(org.eclipse.core.resources.IResource resource)
           
static void markExpiredGuvnorResource(org.eclipse.core.resources.IResource resource)
           
static ResourceHistoryEntry[] parseHistoryProperties(Properties entryProps)
           
static void setGuvnorMetadataProps(org.eclipse.core.runtime.IPath controlledFile, GuvnorMetadataProps mdProps)
           
static void writeGuvnorMetadataProps(File mdFile, GuvnorMetadataProps mdProps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuvnorMetadataUtils

public GuvnorMetadataUtils()
Method Detail

findGuvnorMetadata

public static org.eclipse.core.resources.IFile findGuvnorMetadata(org.eclipse.core.resources.IResource resource)
Finds the local Guvnor metadata file associated with a given resource.

Parameters:
resource - The resource to locate metadata for.
Returns:
The metadata file for the given resource, null if metadata is not found.

addResourceToGuvnor

public static boolean addResourceToGuvnor(String repLoc,
                                          String targetLoc,
                                          org.eclipse.core.resources.IFile selectedFile)
Adds a resource to Guvnor.

Parameters:
repLoc - The location of the Guvnor repository
targetLoc - The location in Guvnor to add the resource
selectedFile - The resource to add
Returns:
true if the resource is added, false if there is already a resource with the same name in the given location.

commitFileChanges

public static void commitFileChanges(org.eclipse.core.resources.IFile selectedFile)
Commits changes to Guvnor.

Parameters:
selectedFile - The Guvnor controlled file with pending changes

findGuvnorMetadata

public static org.eclipse.core.resources.IFile findGuvnorMetadata(org.eclipse.core.runtime.IPath resource)
Finds the local Guvnor metadata file associated with a given resource.

Parameters:
resource - The resource path to locate metadata for.
Returns:
The metadata file for the given resource, null if metadata is not found.

isGuvnorControlledResource

public static boolean isGuvnorControlledResource(org.eclipse.core.resources.IResource resource)

loadGuvnorMetadata

public static GuvnorMetadataProps loadGuvnorMetadata(org.eclipse.core.resources.IFile mdFile)
                                              throws Exception
Throws:
Exception

getGuvnorMetadata

public static GuvnorMetadataProps getGuvnorMetadata(org.eclipse.core.resources.IResource resource)
                                             throws Exception
Throws:
Exception

writeGuvnorMetadataProps

public static void writeGuvnorMetadataProps(File mdFile,
                                            GuvnorMetadataProps mdProps)
                                     throws Exception
Throws:
Exception

setGuvnorMetadataProps

public static void setGuvnorMetadataProps(org.eclipse.core.runtime.IPath controlledFile,
                                          GuvnorMetadataProps mdProps)
                                   throws Exception
Throws:
Exception

createGuvnorMetadataLocation

public static org.eclipse.core.runtime.IPath createGuvnorMetadataLocation(String rootPath)
                                                                   throws Exception
Throws:
Exception

getGuvnorMetadataFile

public static File getGuvnorMetadataFile(String path,
                                         String fname)

getGuvnorControlledResource

public static org.eclipse.core.resources.IFile getGuvnorControlledResource(org.eclipse.core.resources.IResource resource)
                                                                    throws Exception
Throws:
Exception

isGuvnorMetadata

public static boolean isGuvnorMetadata(org.eclipse.core.resources.IResource resource)

markCurrentGuvnorResource

public static void markCurrentGuvnorResource(org.eclipse.core.resources.IResource resource)
                                      throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

markExpiredGuvnorResource

public static void markExpiredGuvnorResource(org.eclipse.core.resources.IResource resource)
                                      throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getGuvnorResourceProperty

public static String getGuvnorResourceProperty(org.eclipse.core.resources.IResource resource)
                                        throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

isGuvnorResourceCurrent

public static boolean isGuvnorResourceCurrent(org.eclipse.core.resources.IResource resource)
                                       throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

parseHistoryProperties

public static ResourceHistoryEntry[] parseHistoryProperties(Properties entryProps)

Drools :: Eclipse :: Guvnor tools 6.1.0.Beta3

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.