net.grinder.engine.common
Class ScriptLocation

java.lang.Object
  extended by net.grinder.engine.common.ScriptLocation
All Implemented Interfaces:
Serializable

public final class ScriptLocation
extends Object
implements Serializable

Pairing of a script file and its root directory. The directory is not necessarily the immediate parent of the file.

Author:
Philip Aston
See Also:
Serialized Form

Constructor Summary
ScriptLocation(Directory directory, File file)
          Constructor.
ScriptLocation(File file)
          Constructor, based on the current working directory.
 
Method Summary
 boolean equals(Object other)
          Equality.
 Directory getDirectory()
          Accessor for the script working directory.
 File getFile()
          Accessor for the script file.
 int hashCode()
          Hash code.
 String toString()
          String representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptLocation

public ScriptLocation(Directory directory,
                      File file)
Constructor.

Parameters:
directory - Script working directory. May be relative (to the CWD).
file - The script file. May be relative (to directory). If absolute, it needn't be below the root directory.

ScriptLocation

public ScriptLocation(File file)
               throws EngineException
Constructor, based on the current working directory.

Parameters:
file - The script file.
Throws:
EngineException - If a file operation failed.
Method Detail

getDirectory

public Directory getDirectory()
Accessor for the script working directory.

Returns:
The directory.

getFile

public File getFile()
Accessor for the script file. The returned File always represents an absolute path.

Returns:
The file.

toString

public String toString()
String representation.

Overrides:
toString in class Object
Returns:
The string.

hashCode

public int hashCode()
Hash code.

Overrides:
hashCode in class Object
Returns:
The hash code.

equals

public boolean equals(Object other)
Equality.

Overrides:
equals in class Object
Parameters:
other - Object to compare.
Returns:
true if and only if we're equal to other.


Copyright © 2000-2013. All Rights Reserved.