de.matthias_burbach.mosaique4eclipse.util
Class Util

java.lang.Object
  extended byde.matthias_burbach.mosaique4eclipse.util.Util

public final class Util
extends java.lang.Object

Holds various low level helper methods.

Author:
Matthias Burbach

Method Summary
static boolean existsInOpenProject(org.eclipse.core.runtime.IPath iPath)
           
static boolean existsInOpenProject(java.lang.String path)
           
static org.eclipse.core.resources.IFile fileToIFile(java.io.File file)
           
static java.io.File iFiletoFile(org.eclipse.core.resources.IFile iFile)
           
static java.lang.String iPathToAbsolutePath(org.eclipse.core.runtime.IPath iPath)
           
static boolean isStrutsConfigFile(java.lang.Object obj)
           
static void transferStreams(java.io.InputStream source, java.io.OutputStream destination)
          Copies from source to destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fileToIFile

public static org.eclipse.core.resources.IFile fileToIFile(java.io.File file)
Parameters:
file - The file to convert.
Returns:
The converted IFile object.

iFiletoFile

public static java.io.File iFiletoFile(org.eclipse.core.resources.IFile iFile)
Parameters:
iFile - The IFile object to convert.
Returns:
The converted file.

existsInOpenProject

public static boolean existsInOpenProject(java.lang.String path)
Parameters:
path - The filesystem path of a file to test for existence in any of the currently open Eclipse projects in the user's workspace.
Returns:
true if the file was found in the workspace.

existsInOpenProject

public static boolean existsInOpenProject(org.eclipse.core.runtime.IPath iPath)
Parameters:
iPath - The IPath path of a file to test for existence in any of the currently open Eclipse projects in the user's workspace.
Returns:
true if the file was found in the workspace.

iPathToAbsolutePath

public static java.lang.String iPathToAbsolutePath(org.eclipse.core.runtime.IPath iPath)
Parameters:
iPath - The IPath path to convert to an absolute filesystem path.
Returns:
The operating system specific absolute filesystem path or null if the path was not found in the workspace.

isStrutsConfigFile

public static boolean isStrutsConfigFile(java.lang.Object obj)
Parameters:
obj - An object to test whether it represents an IFile which is a Struts configuration file (name starts with 'struts-config').
Returns:
true if the object is recognized to be a Struts config.

transferStreams

public static void transferStreams(java.io.InputStream source,
                                   java.io.OutputStream destination)
                            throws java.io.IOException
Copies from source to destination.

Parameters:
source - The source to copy bytes from. Must not be null.
destination - The destination to copy bytes to. Must not be null.
Throws:
java.io.IOException - if anything goes wrong


Copyright © 2005-2006 . All Rights Reserved.