Data Request Broker
2-3-release

fr.gael.drb.impl.file
Class FileFactory

java.lang.Object
  extended by fr.gael.drb.impl.file.FileFactory
All Implemented Interfaces:
DrbFactoryImpl

public final class FileFactory
extends Object
implements DrbFactoryImpl

Factory of local file or directory nodes. This class implements the DrbFactoryImpl interface to create fr.drb.impl.file.File nodes that handles file system elements such has directories or files. This factory is not supposed to be used directly from any component but has been designed for the fr.gael.drb.Factory class.

See Also:
File, DrbFactory

Constructor Summary
FileFactory()
           
 
Method Summary
 String getIdentifier()
          Returns "file" string.
 String getName()
          Returns "Local file system" string.
 DrbNode open(DrbNode base_node)
          Opens the node from an existing node.
 DrbNode open(File file)
          Creates a file node from an abstract path file.
 DrbNode open(String file_path)
          Create a file node matching the provided path.
 DrbNode open(URL url)
          Create a file node matching the provided URI.
 DrbNode open(URL uri, DrbNode base_node)
          Opens the node matching a given URI from an existing node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFactory

public FileFactory()
Method Detail

getIdentifier

public final String getIdentifier()
Returns "file" string. "file" is defined as scheme identifier of the implementation.

Specified by:
getIdentifier in interface DrbFactoryImpl
Returns:
"file".

getName

public final String getName()
Returns "Local file system" string. "Local file system" stands as the name of the implementation.

Specified by:
getName in interface DrbFactoryImpl
Returns:
"Local file system".

open

public final DrbNode open(URL url)
Create a file node matching the provided URI. The returned node may correspond to a directory or a file depending of the resource pointed by the provided URI. Note : The URI scheme (i.e. file protocol is not checked and is considered as default).

Specified by:
open in interface DrbFactoryImpl
Parameters:
url - The "Uniform Resource Locator" (URL) to be handled. This parameter shall not be null.
Returns:
A reference to a File node or null if the URL does not match any component of the local file system.

open

public final DrbNode open(String file_path)
Create a file node matching the provided path. The returned node may correspond to a directory or a file depending of the resource pointed by the provided path.

Parameters:
file_path - The path of the target file. This parameter shall not be null.
Returns:
A reference to a File node or null if the path does not match any component of the local file system.

open

public final DrbNode open(DrbNode base_node)
Opens the node from an existing node. The current implementation of file does not support this operation and returns always a null reference disregarding the input node.

Specified by:
open in interface DrbFactoryImpl
Parameters:
base_node - A node reference that is not considered.
Returns:
Always null.

open

public final DrbNode open(URL uri,
                          DrbNode base_node)
Opens the node matching a given URI from an existing node. This operation returns a reference to a File node has done by the open(URL uri) operation, disregarding the input node.

Specified by:
open in interface DrbFactoryImpl
Parameters:
uri - The "Uniform Resource Identifier" (URI) to be handled. This parameter shall never be null.
base_node - Not considered.
Returns:
A reference to a File node or null if the URI does not match any component of the local file system.

open

public final DrbNode open(File file)
Creates a file node from an abstract path file.

Parameters:
file - the abstract path file of the file to be opened.
Returns:
A reference to a File node or null if the input abstract path file is null.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .