I'm not familiar with JBoss, but typically this would accessable from the from the WebApp's root directory. Depending on the platform (OS & App Server) other directories may or may not be accessable.
I usually use this little helper class to drop a file in the WebApps root.
import java.io.IOException;
import java.io.FileWriter;
import java.util.Date;
import java.text.DateFormat;
/**
* A helper class that can be used to mark directories
*/
public class DirectoryUtils {
/**
* mark the default data directory with a
* marker derived from the calss name.
* Usage
*<CODE>
*DirectoryUtils.markDirectory( this ) ;
*DirectoryUtils.markDirectory( getClass().getName() ) ;
*</CODE>
* @param that object from which to derive class name
* @return <tt>true</tt> if sucessfull
* @deprecated this is redundant calls may be removed.
*/
public static boolean markDirectory( Object that ) {
return markDirectory( that.getClass().getName() ) ;
}
/**
* Marks the data directory with a marker.
* Usage
*<CODE>
*DirectoryUtils.markDirectory( this ) ;
*DirectoryUtils.markDirectory( getClass().getName() ) ;
*</CODE>
* @param dataFileName the class name to be used as a filename
* @return <CODE>true</CODE> if sucessfull
* @deprecated this is redundant calls may be removed.
*/
public static boolean markDirectory( String dataFileName ) {
boolean bRetVal = false ;
String _dataFileName = dataFileName + ".cwd" ;
String content = "# " + _dataFileName ;
String timeStamp = "# " + DateFormat.getDateTimeInstance().format( new Date() ) ;
try {
FileWriter fileWriter = new FileWriter( _dataFileName ) ;
fileWriter.write( content, 0, content.length() ) ;
fileWriter.write( timeStamp, 0, timeStamp.length() ) ;
fileWriter.flush() ;
fileWriter.close() ;
bRetVal = true;
}
catch ( IOException e) {
System.err.println( "markDirectory() : " + e.toString() ) ;
e.printStackTrace() ;
}
return bRetVal ;
}
}