• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Check the file/found or not

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

I have a file in c:\window\test.dll.... i want to create a program so that i should check the file present in that directory or not......

Please give some idea....

-Rodricks
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Rodricks george
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much sir.....
 
Rodricks george
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,
The File Checking program i have written in action class.... if i deploy it in weblogic in Linux server and if i get access to that action class it is checking That machine OS information but i am opening the application in Windows PC..... it is not checking in my PC.... What to do to get my PC information... pls solve that

-Rodricks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

it is not checking in my PC


What does that mean? Are you running the code Rahul posted and it is not giving the correct result?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Rodricks george , could not get much from you post. ;-)
 
Rodricks george
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

This is my code


String osname=System.getProperty("os.name");
System.out.println(osname);
String userHome=System.getProperty("user.home");
System.out.println("User Home Direcory:->"+userHome);




boolean exists = (new File("C:/WINDOWS/jtwain.dll")).exists();
if (exists) {
// File or directory exists
System.out.println("Found jtwain.dll");
return mapping.findForward("success");
} else {
// File or directory does not exist
System.out.println("Not Found jtwain.dll");
request.getSession().setAttribute("winDir","C:/WINDOWS");
return mapping.findForward("fail");
}



i wrote this one in action class..... i deployed the struts program in weblogic in linux OS...... While executing the application from server i got only linux machine system properties.... I want client side system properties...... whoever open my website i should get their system properties...... so that if they dont have the corresponding dll file...i will ask them to install it in c:\windows directory.... Pleas help me how to check the file found or not in client side.

-Rodricks
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Action class is part of struts framework and will be executed in the server side. So its obvious that you will get the properties of the server machine , now the client machine.

Though I have not worked on applets , but I think applet would be the choice if you want to do something like this as the applet bytecodes will get executed on the client side , not on the server.
 
Rodricks george
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Rahul Sir,

As you said i created a J applet Program and got the client details and got the user.home information and checked the windows folder and i redirected to a jsp from applet and the program is successfully running... Thank you sir for really perfect information at rite time...

-Rodricks
 
Message for you sir! I think it is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic