• Post Reply Bookmark Topic Watch Topic
  • New Topic

unable to open the specific file

 
samrat
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All users here...

When we give a word in Search option of Windows...it displays the links to the specified file or Directory..isn't it!
i am displaying the links(absolute path) in the browser, but iam unable to open the specific file(Clicked file) in corresponding application.
i got third party api that is JNDI. in that we have the functionality to open a particular file.

Using the JDIC API we can open patticular file(by passing absolute path)


Ex. Desktop.open(absolute path of file);

i have to open the file(onclick) in that particular application.
pls help me out.






<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="org.jdesktop.jdic.desktop.*" %>
<%!
public List lFiles(List list, String dir) {
File dn = new File(dir);
File fList[] = dn.listFiles();
String s="xyz.txt";

for(int i=0;i<fList.length;i++) {
if(fList[i].isDirectory()) {
lFiles(list, fList[i].getAbsolutePath());
}
else if((fList[i].getName()).equals(s)) {
list.add(fList[i].getAbsolutePath());
System.out.println(list);
}
}
return list;
}
%>
<%
File f[] = File.listRoots();
for(int i=2;i<=4;i++){
String dir = f[i].getAbsolutePath();
Vector list=new Vector();
lFiles(list, dir);
for(int x=0;x<list.size();x++)
{
String sr=(String)list.get(x);
File fl= new File(sr);
%>
<a href="<%out.println(fl);%>"><br><%out.println(fl);%></a>

<%

}

}

%>
[ July 06, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your question is truly urgent, then your best bet for getting answers is to ask your question in smart ways.

Using "urgent" as a title isn't one of them. Read this and this for helpful hints.

I have modified your title for you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, please modify your display name to be mixed case rather than all uppercase. Our eyes will thank you!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
samrat,

Bear only asked that you change your 'valid' screen name to mixed case.
You've changed it to an invalid one.
There must be a first and a last name.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!