commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hns <hardik_...@yahoo.com>
Subject use of apache common VFS
Date Fri, 11 Apr 2008 08:11:06 GMT

hi
i am newbie of apache common vfs

i have developed one web application which works currently on lan 
in my apps one module i have do such that 
using html tag input type=file, i have input a path value of the file
resides on client computer
at the bean side i have wrote fuction flieheader and call through jsp
---------------------------------------------------------------------------------------------
 public boolean fileheadr(String fname) 
{
    	File file = new File(fname);
	    try {
	      fis = new FileInputStream(file);
	      // Here BufferedInputStream is added for fast reading.
	      bis=null;
	      dis=null;
	      headr=null;
	      isheadr=false;
	      bis = new BufferedInputStream(fis);
	      dis = new DataInputStream(bis);
	      
	      if(dis.available() !=0)
	    	  
	      {	  
	    	  // dis.available() returns 0 if the file does not have more lines.
	    	  //while (dis.available() != 0) {

	    	  // this statement reads the line from the file and print it to
	    	  	// the console.
	         headr=dis.readLine();
	         	//}
	         if(headr.equalsIgnoreCase("Sim	Msisdn	Mrp"))
	         {
	        	 isheadr=true;
	        	// headr="right";
	         }
	      // dispose all the resources after using them.
	      }
	         fis.close();
	         bis.close();
	         dis.close();
	      
	    } 
	    catch (FileNotFoundException e) 
	    {
	      e.printStackTrace();
	    }
	    catch (IOException e) 
	    {
	      e.printStackTrace();
	    }
	    
	    return isheadr;
	}
--------------------------------------------------------------------------------------------
but it gives error in server logs java.io.filenotfound exception ,beacuse
server try to find particular file in 
its local drive while its on clients local drive 

now how can i achieve solution of this problem using vfs 

please help me 
  
-- 
View this message in context: http://www.nabble.com/use-of-apache-common-VFS-tp16626988p16626988.html
Sent from the Commons - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message