org.n52.security.common.util
Class FileFinder

java.lang.Object
  extended by org.n52.security.common.util.FileFinder

public class FileFinder
extends java.lang.Object

Class FileFinder is a helper class to encapsulate the typical finding of a file.

todo: maybe we can align the resource concept of spring to such tasks.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 24.07.2008

Constructor Summary
FileFinder()
          Constructor creates a new instance.
FileFinder(java.lang.String fileName)
          Constructor creates a new instance.
 
Method Summary
 java.io.File getFile()
          Method gets the file for a given file name.
 java.lang.String getFileName()
          Method gets the fileName.
 java.io.InputStream getInputStream()
          Method gets the inputStream for a given file name.
 void setFileName(java.lang.String fileName)
          Method sets the fileName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFinder

public FileFinder()
Constructor creates a new instance.


FileFinder

public FileFinder(java.lang.String fileName)
Constructor creates a new instance.

Parameters:
fileName - the fileName.
Method Detail

getFileName

public java.lang.String getFileName()
Method gets the fileName.

Returns:
String.

setFileName

public void setFileName(java.lang.String fileName)
Method sets the fileName.

Parameters:
fileName - the fileName.

getInputStream

public java.io.InputStream getInputStream()
Method gets the inputStream for a given file name.

Works not with directories. (self explaining or). But it is able to get strems from files within jars.

Returns:
InputStream.

getFile

public java.io.File getFile()
Method gets the file for a given file name.

It checks the existence of the file, but this can be a directory, too.

Returns:
File.


Copyright © 2004-2009 52north.org. All Rights Reserved.