HI
Thankz for your replies. Actually we r developing an Intranet application in which the user should specify the resource files and the result files folder which is in the server.So i need a validation to validate the entered file path is correct and available. Now i got another solution.tht is
/* to hold the file path */
StringBuffer localSBFilePath = new StringBuffer( File.separator);
/* to hold the boolean value for long term files folder exists */
boolean localIsLongTermFolderExists = false;
/* to hold the long term files folder */
String localLongTermFilesFolder = null;
/* to hold the FILE */
File localFile = null;
/* get the long term files folder */
localLongTermFilesFolder = PrimaryServerAdminPKForm.getPServerStorage();// Here PrimaryServerAdminPKForm is an form bean using Struts.
/* append the file path*/
localSBFilePath.append(localLongTermFilesFolder);
localFile = new File(localSBFilePath.toString());
/* check the folder exists in the given path */
localIsLongTermFolderExists = localFile.isDirectory();
/* if not throw exception */
if (!(localIsLongTermFolderExists))
{
throw new AppsCustomException("error.PrimaryServerAdminPKForm.primaryserver.FileNotFound");
}
Thankz for all
cheers mite
Rajesh G.
I'm a little confused here. Lets say this is an upload page were the user enters the path or clicks the browse button, whichever he/she prefers. How exactly do you get that file off their computer since there is so many restrictions with java?