Sonic Management API

com.sonicsw.mx.config.util
Class SonicFSFile

java.lang.Object
  extended by com.sonicsw.mx.config.util.SonicFSFile

public class SonicFSFile
extends java.lang.Object

This class is a wrapped around a file or directory returned my the SonicFSFileSystem. This class encapsultates information about the file, it's name, size, createdBy and lastModified


Method Summary
 boolean equals(java.lang.Object o)
          Test if this SonicFSFile is equal to the specified Object
 java.lang.String getCreatedBy()
          Returns the creator
 long getCreationTimestamp()
          Returns the creationTimestamp.
 java.lang.String getFullName()
          Returns the full name.
 long getLastModified()
          Returns the lastModified.
 java.lang.String getName()
          Returns the name.
 java.lang.String getParent()
          Returns the pathname string of this abstract pathname's parent, or null if this pathname does not name a parent directory.
 SonicFSFile getParentFile()
          Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not name a parent directory.
 int getSize()
          Returns the size.
 boolean isAbsolute()
          Tests whether this abstract pathname is absolute.
 boolean isDirectory()
          Tests whether the file denoted by this resource info is a directory.
 boolean isFile()
          Tests whether the file denoted by this resource info is a normal file.
 boolean isParent(SonicFSFile file)
          Tests whether this SonicFSFile is the parent of the specified file
static java.lang.String toName(java.lang.String name)
          Given a full path to a file, return the filename (the last component in the path).
static java.lang.String toParent(java.lang.String name)
          Returns the parent String for the specified path
 java.lang.String toString()
          Return the string representation of this SonicFSFile.
 java.lang.String toURL()
          Convert this SonicFSFile into a fully qualified URL e.g.sonicfs:///
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(java.lang.Object o)
Test if this SonicFSFile is equal to the specified Object

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:

getCreatedBy

public java.lang.String getCreatedBy()
Returns the creator

Returns:
String

getCreationTimestamp

public long getCreationTimestamp()
Returns the creationTimestamp.

Returns:
long

getFullName

public java.lang.String getFullName()
Returns the full name.

Returns:
String

getLastModified

public long getLastModified()
Returns the lastModified.

Returns:
long

getName

public java.lang.String getName()
Returns the name.

Returns:
String

getParent

public java.lang.String getParent()
Returns the pathname string of this abstract pathname's parent, or null if this pathname does not name a parent directory. The parent of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last. If the name sequence is empty then the pathname does not name a parent directory.

Returns:
The pathname string of the parent directory named by this abstract pathname, or null if this pathname does not name a parent

getParentFile

public SonicFSFile getParentFile()
Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not name a parent directory. The parent of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last. If the name sequence is empty then the pathname does not name a parent directory.

Returns:
The abstract pathname of the parent directory named by this abstract pathname, or null if this pathname does not name a parent

getSize

public int getSize()
Returns the size.

Returns:
int

isAbsolute

public boolean isAbsolute()
Tests whether this abstract pathname is absolute. A pathname is absolute if its prefix is "/".

Returns:
true if this abstract pathname is absolute, false otherwise

isDirectory

public boolean isDirectory()
Tests whether the file denoted by this resource info is a directory.

Returns:
true if and only if the directory exists; false otherwise

isFile

public boolean isFile()
Tests whether the file denoted by this resource info is a normal file. A file is normal if it is not a directory and, in addition, satisfies other system-dependent criteria.

Returns:
true if and only if the file exists and is a normal file; false otherwise

isParent

public boolean isParent(SonicFSFile file)
Tests whether this SonicFSFile is the parent of the specified file


toName

public static java.lang.String toName(java.lang.String name)
Given a full path to a file, return the filename (the last component in the path).


toParent

public static java.lang.String toParent(java.lang.String name)
Returns the parent String for the specified path


toString

public java.lang.String toString()
Return the string representation of this SonicFSFile.

Overrides:
toString in class java.lang.Object
Returns:

toURL

public java.lang.String toURL()
Convert this SonicFSFile into a fully qualified URL e.g.sonicfs:///

Returns:

Sonic Management API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.