[opencms-dev] jsp - check if external file exists - pls help

aruc97 at virgilio.it aruc97 at virgilio.it
Tue Jan 20 16:54:10 CET 2009


Hi all,
i'm using opencms 7.0.4+apache+tomcat+modrewrite+multisite in a 
linux environment;
everythings works properly.
i have to implement the 
following task:

check if a given file exists inside an external folder 
of reachable windows server (over the same network of the opencms 
server).

in opencms,
i have created the following code inside a .jsp 
page:

<%@ page import="java.util.*, org.opencms.jsp.*, java.io.*"
     
buffer="none"
     session="false"
%>

<%
  File myfile = new File
("\\\\ip_of_external_reachable_server\\folder\\filename_to_check.
txt"); 
        if (myfile.exists()){
           out.println("file 
exists");
        }else{
           out.println("file does not exist");
        }
%>
---------------------
the above code always output: "file 
does not exist"
without any errors;
even if the file is really present 
onto the external server.

is this problem due to the "opencms VFS 
limitation", so that the resource
is always checked inside the VFS and 
can not be an external UNC ?

can you help me finding the right code to 
accomplish the above task ?

thanks in advance,
Stefano.




More information about the opencms-dev mailing list