This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

how to read files from remote system  RSS feed

 
Santosh Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi

i am trying to read fiels from remote system.
i've got all the access and sharing permissionsfor the particular directory on the remote system.

when i try opening the directory form windows run i am able to access the
directory, create new folders and delete folders etc.. but when i am using the same path in program i am not able to access the directory or folders.
i am getting a Nullpointer error.

the code i am using is

----------------
<%@ page language="java" import="java.io.*,java.lang.String,java.util.regex.*,java.io.File,java.util.*,java.util.List,java.lang.*" %>
<%!
//getting file name and url
Map mapfiles = new HashMap();
Map showFiles(File file)
{
File[] files = file.listFiles();
if(file.isDirectory())
{
for(int i=0;i<files.length; i++)
{
showFiles(files[i]);
}
}
else
{
String path = file.getPath();
String name = file.getName();
mapfiles.put(path,name);
}
return mapfiles;
}
%>

<%
File file_mem = new File("\\\\systemname\\dir1\\dir2\\dir3\\");
showFiles(file_mem);
out.println(mapfiles.size());
Iterator iterator_mapfiles = mapfiles.keySet().iterator();
while(iterator_mapfiles.hasNext())
{
boolean filefound_mem=false;
String fpath= (String)iterator_mapfiles.next();
String fname= (String)mapfiles.get(fpath);

// out.println(fpath +" " +fname+"<br>");
out.println(fpath+"<br>");
%>

<%--<a href="\<%=fpath%>">fpath</a>
<a href="\<%=fpath%>">fname</a><br>--%>
<%
}
%>

</P>
</BODY>
</HTML>


what has to be done
waiting for your reply



regards
santosh
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Report post to moderator
I guess this will helpful to you.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!