21) Manipulate Files and Directories without using a HttpServletRequest object.

 

back to main index

 

Xload provides facilities to manipulate Files and Directories without the need of a HttpServletRequest object. An XloadManager object is created that does not wrap a HttpServletRequest object, which can then be used to access, create, draw information from files or directories from the underlying file system. A number of methods are unavailable to use when Xload is used in this configuration but these are methods that are to do with uploading files, which are obviously redundant in this case. Below is an example of how to use Xload in this way. There is another example in the Putting it All Together section, specifically, File and Directory Manipulation.

 

IMPORTANT:- When using Xload in this configuration then all paths have to be absolute. The paths are then obviously dependant on the underlying operating system.

 

 

 

XloadManager xman = new XloadManager();

 

XloadDirectory dir = xman.getDirectory("/data/files/");

...

...

//more manipulation here.

...

XloadDirectory dir1 = dir.createDirectory("newdirectory");

...

...

//more manipulation here etc.

 

 

 

 

As we can see, it is very simple to use Xload in this configuration, totally separate to any request architecture. Xload can quite happily be used like this in another environment if so required, using the methods available to it while working in this configuration outside the remit of a web application; this demonstrates the total flexibility and versatility of Xload.

 

back to main index

top of page

 

 

 

© Gubutech(Xload) 2006  (v1.2)