Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

how to read files from remote system  RSS feed

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

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.lang.String,java.util.regex.*,,java.util.*,java.util.List,java.lang.*" %>
//getting file name and url
Map mapfiles = new HashMap();
Map showFiles(File file)
File[] files = file.listFiles();
for(int i=0;i<files.length; i++)
String path = file.getPath();
String name = file.getName();
return mapfiles;

File file_mem = new File("\\\\systemname\\dir1\\dir2\\dir3\\");
Iterator iterator_mapfiles = mapfiles.keySet().iterator();
boolean filefound_mem=false;
String fpath= (String);
String fname= (String)mapfiles.get(fpath);

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

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


what has to be done
waiting for your reply

Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Report post to moderator
I guess this will helpful to you.
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!