lumis.portal.filesystem
Class PortalFilePath

Package class diagram package PortalFilePath
java.lang.Object
  extended by lumis.portal.filesystem.PortalFilePath
All Implemented Interfaces:
Serializable

@StableMinor(version="6.2",
             sinceVersion="4.1")
public final class PortalFilePath
extends Object
implements Serializable

Represents a path to a portal file. It is internally stored as a PortalBaseFolder and a relative path to that folder.

Since:
4.1.0
See Also:
Serialized Form

Constructor Summary
PortalFilePath(IPortalBaseFolder baseFolder, String relativePath)
          Creates a portal file path from a base folder and a relative path.
PortalFilePath(PortalBaseFolder baseFolder, String relativePath)
          Creates a portal file path from a base folder and a relative path.
PortalFilePath(String absolutePath)
          Creates a portal file path from an absolute path.
 
Method Summary
 boolean equals(Object obj)
           
 String getAbsolutePath()
          Returns the absolute path this instance corresponds to.
 PortalBaseFolder getBaseFolder()
          Deprecated. Since 6.2.0 replaced by getPortalBaseFolder() due to the deprecation of PortalBaseFolder.WWW. This deprecated implementation works if this PortalFilePath is based on one of the enum PortalBaseFolder options, otherwise it throws a ClassCastException. This works on a full legacy code, since only the those enum options exist in such case.
 IPortalBaseFolder getPortalBaseFolder()
          Returns the base folder for this path.
 String getRelativePath()
          Returns the relative path to getBaseFolder().
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortalFilePath

public PortalFilePath(PortalBaseFolder baseFolder,
                      String relativePath)
Creates a portal file path from a base folder and a relative path.

This constructor is equivalent to PortalFilePath(IPortalBaseFolder, String), but is kept for binary backwards compatibility.

Parameters:
baseFolder - the base folder.
relativePath - the relative path, relative to the base folder.
Since:
4.1.0

PortalFilePath

public PortalFilePath(IPortalBaseFolder baseFolder,
                      String relativePath)
Creates a portal file path from a base folder and a relative path.

Parameters:
baseFolder - the base folder.
relativePath - the relative path, relative to the base folder.
Throws:
IllegalArgumentException - if a PortalFilePath could not be created due to invalid argument values.
Since:
6.2.0

PortalFilePath

public PortalFilePath(String absolutePath)
Creates a portal file path from an absolute path.

Parameters:
absolutePath - the absolute path.
Throws:
IllegalArgumentException - if the given absolute path is invalid or does not belongs to an area that may be mapped using a portal file path.
Since:
4.1.0
Method Detail

getAbsolutePath

public String getAbsolutePath()
Returns the absolute path this instance corresponds to.

Returns:
the absolute path this instance corresponds to.
Since:
4.1.0

getRelativePath

public String getRelativePath()
Returns the relative path to getBaseFolder().

Returns:
the relative path relative to the base folder.
Since:
4.1.0

getBaseFolder

@Deprecated
public PortalBaseFolder getBaseFolder()
Deprecated. Since 6.2.0 replaced by getPortalBaseFolder() due to the deprecation of PortalBaseFolder.WWW. This deprecated implementation works if this PortalFilePath is based on one of the enum PortalBaseFolder options, otherwise it throws a ClassCastException. This works on a full legacy code, since only the those enum options exist in such case.

Returns the base folder for this path.

Returns:
the base folder for this path.
Since:
4.1.0

getPortalBaseFolder

public IPortalBaseFolder getPortalBaseFolder()
Returns the base folder for this path.

Returns:
the base folder for this path.
Since:
6.2.0

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.