Class SlideTest

java.lang.Object
  extended by SlideTest
All Implemented Interfaces:
java.lang.Runnable

public class SlideTest
extends java.lang.Object
implements java.lang.Runnable

This class tests the Slide WebDAV client library found at jakarta.apache.org/slide It connects to a hard-coded location at the DFS filesystem at CERN, and performs disk operations like creating file, showing directories and files, saving files to the local filesystem ++


Field Summary
(package private)  java.io.BufferedReader br
           
(package private)  java.lang.String password
           
(package private)  boolean run
           
(package private)  java.lang.Thread t
           
(package private)  org.apache.webdav.lib.WebdavResource wdr
           
 
Constructor Summary
SlideTest(java.lang.String password)
          This constructor creates a new thread to handle keyboard input.
 
Method Summary
 void actionCreateDir()
          Creates a new directory in the working directory for the WebdavResource
 void actionCreateFile()
          Creates a file with the specified file name from the first input and with the content specified in the second input
 void actionImport()
          Imports a file from the local file system.
 void actionList()
          Lists all the directories and all the files for this WebdavResource
 void actionQuit()
          Quits the command line interface
 void actions(java.lang.String action)
          Calls the right method depending on the user input.
 void actionSave()
          Saves a file to the local file system Demands the user for the path to the file that should be saved and saves this file at a local location demanded by the user.
 void actionToDirectory()
          Sets the WebdavResource pointer to the new directory given by the user input If a wrong directory is specified the system will exit, this should be changed to just give an error message
static void main(java.lang.String[] args)
          Main method only creating an instance of the class
 void receiveInput()
          This method waits for the input from the command line and then calls the actions()-method
 void run()
          Basically a method that calls the receiveInput()-method as long as the user hasn't issued the 'quit' command
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

t

java.lang.Thread t

wdr

org.apache.webdav.lib.WebdavResource wdr

run

boolean run

password

java.lang.String password

br

java.io.BufferedReader br
Constructor Detail

SlideTest

public SlideTest(java.lang.String password)
This constructor creates a new thread to handle keyboard input. It then tries to connect to the WebDAVResource hardcoded in an HttpsURL. If a successfull connection is created, the thread is started and the user can issue keyboard inputs

Parameters:
password - the password for the hardcoded resource
Method Detail

main

public static void main(java.lang.String[] args)
Main method only creating an instance of the class

Parameters:
args - input needs to be the password for the DFS access

run

public void run()
Basically a method that calls the receiveInput()-method as long as the user hasn't issued the 'quit' command

Specified by:
run in interface java.lang.Runnable

receiveInput

public void receiveInput()
This method waits for the input from the command line and then calls the actions()-method


actions

public void actions(java.lang.String action)
Calls the right method depending on the user input. Either list, creatfile, todir, quit, createdir, save or import (currently not working). If the action is not listed here, the user is prompted for a new input

Parameters:
action - the keyboard input string from the user

actionSave

public void actionSave()
Saves a file to the local file system Demands the user for the path to the file that should be saved and saves this file at a local location demanded by the user. The user has to know the structure of the local file system to be able to give a correct path with file name for the local file system


actionImport

public void actionImport()
Imports a file from the local file system. Does not currently work for some reason


actionCreateDir

public void actionCreateDir()
Creates a new directory in the working directory for the WebdavResource


actionQuit

public void actionQuit()
Quits the command line interface


actionCreateFile

public void actionCreateFile()
Creates a file with the specified file name from the first input and with the content specified in the second input


actionToDirectory

public void actionToDirectory()
Sets the WebdavResource pointer to the new directory given by the user input If a wrong directory is specified the system will exit, this should be changed to just give an error message


actionList

public void actionList()
Lists all the directories and all the files for this WebdavResource