org.ow2.weblab.services.iterator
Class FolderResourceConf

java.lang.Object
  extended by org.ow2.weblab.services.iterator.FolderResourceConf
All Implemented Interfaces:
org.ow2.weblab.core.services.Configurable

public class FolderResourceConf
extends java.lang.Object
implements org.ow2.weblab.core.services.Configurable

This class is a the Configurable part of the FolderResource service. It enable to configure the folder to be crawled by usageContext or to reset configurations. The PoK of configuration:

Author:
ymombrun
See Also:
InterfacesMappingSingleton
Date:
2011-08-18

Constructor Summary
FolderResourceConf(ConfigurationBean configuration)
          The constructor that takes as parameter the same bean than the queue manager to be associated with.
 
Method Summary
static java.io.File checkFolder(java.lang.String path, java.lang.String usageContext)
          Checks that the given path denotes an existing readable folder.
 org.ow2.weblab.core.services.configurable.ConfigureReturn configure(org.ow2.weblab.core.services.configurable.ConfigureArgs args)
           
 java.lang.String readConfigPoK(java.lang.String usageContext, org.ow2.weblab.core.model.PieceOfKnowledge conf)
          Reads the PieceOfKnowledge in parameter to retrieve path to the folder to be crawled.
 org.ow2.weblab.core.services.configurable.ResetConfigurationReturn resetConfiguration(org.ow2.weblab.core.services.configurable.ResetConfigurationArgs args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderResourceConf

public FolderResourceConf(ConfigurationBean configuration)
The constructor that takes as parameter the same bean than the queue manager to be associated with.

Parameters:
configuration - The configuration used here.
Method Detail

configure

public org.ow2.weblab.core.services.configurable.ConfigureReturn configure(org.ow2.weblab.core.services.configurable.ConfigureArgs args)
                                                                    throws org.ow2.weblab.core.services.InvalidParameterException,
                                                                           org.ow2.weblab.core.services.AccessDeniedException,
                                                                           org.ow2.weblab.core.services.UnexpectedException
Specified by:
configure in interface org.ow2.weblab.core.services.Configurable
Throws:
org.ow2.weblab.core.services.InvalidParameterException
org.ow2.weblab.core.services.AccessDeniedException
org.ow2.weblab.core.services.UnexpectedException

resetConfiguration

public org.ow2.weblab.core.services.configurable.ResetConfigurationReturn resetConfiguration(org.ow2.weblab.core.services.configurable.ResetConfigurationArgs args)
                                                                                      throws org.ow2.weblab.core.services.InvalidParameterException,
                                                                                             org.ow2.weblab.core.services.UnexpectedException
Specified by:
resetConfiguration in interface org.ow2.weblab.core.services.Configurable
Throws:
org.ow2.weblab.core.services.InvalidParameterException
org.ow2.weblab.core.services.UnexpectedException

readConfigPoK

public java.lang.String readConfigPoK(java.lang.String usageContext,
                                      org.ow2.weblab.core.model.PieceOfKnowledge conf)
                               throws org.ow2.weblab.core.services.InvalidParameterException
Reads the PieceOfKnowledge in parameter to retrieve path to the folder to be crawled.

Parameters:
usageContext - The usageContext send as parameter of the configuration.
conf - The PoK that should contain the configuration.
Returns:
The path to the folder to crawl (not tested).
Throws:
org.ow2.weblab.core.services.InvalidParameterException - If no configuration has been found (linked with the service Uri) or if no folder to crawl is provided in this configuration.

checkFolder

public static java.io.File checkFolder(java.lang.String path,
                                       java.lang.String usageContext)
                                throws org.ow2.weblab.core.services.AccessDeniedException
Checks that the given path denotes an existing readable folder.

Parameters:
path - The path to check validity
usageContext - The usageContext, used only for logging purpose.
Returns:
An existing, readable directory.
Throws:
org.ow2.weblab.core.services.AccessDeniedException - If the path does not exist, or is not readable or is not a directory.


Copyright © 2004-2011. All Rights Reserved.