Results 1 to 15 of 15
- 12-10-2012, 10:23 AM #1
- 12-10-2012, 12:30 PM #2
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
Re: How to get details of drives of system over LAN via IP address
I hope you can't "get all drives details of a system over the LAN" without the cooperation of the owners since to my mind this would represent a security hole. Why do you think you need this information?
Last edited by sabre150; 12-10-2012 at 01:08 PM.
- 12-11-2012, 06:28 AM #3
Re: How to get details of drives of system over LAN via IP address
Hello,
Thanks for your reply, the owners will allow to see the information.sanjeev,संजीव
- 12-11-2012, 07:38 AM #4
Re: How to get details of drives of system over LAN via IP address
I think you missed sabre150's point. Also, you didn't answer his question.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-11-2012, 09:51 AM #5
- 12-11-2012, 10:30 AM #6
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
Re: How to get details of drives of system over LAN via IP address
I am always worried when I see a requirement such as you are asking for; I can't see what the powers that be can hope to do with the information. Of course the information will depend on what OS the machines are running and what mountable drives are currently mounted.
Looks to me like you are going to either
a) setup a server on each machine which responds to a request with the desired information. Something like Tomcat could be used for that with a simple Servlet that extracts the information from the system.
or
b) create a process on each machine which broadcasts the desired information. Almost any programming language could be used for this.
- 12-11-2012, 10:33 AM #7
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
- 12-12-2012, 07:14 AM #8
- 12-12-2012, 08:53 AM #9
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
Re: How to get details of drives of system over LAN via IP address
Last edited by sabre150; 12-12-2012 at 08:58 AM.
- 12-12-2012, 10:40 AM #10
- 12-12-2012, 10:57 AM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: How to get details of drives of system over LAN via IP address
I think sabre150 is pointing out to you that you are going to have to write this.
It's not something that a normal setup actually uses, so is unlikely to be found in an existing API.
Not everything in our industry is downloadable from the internet. Especially things with odd requirements.Please do not ask for code as refusal often offends.
- 12-12-2012, 11:17 AM #12
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
Re: How to get details of drives of system over LAN via IP address
Until now that was not obvious from anything you have posted in this thread. You could of course have communicated this in response to the technical solutions I gave earlier rather than just ignoring it.
You need to use a whole load of different features - not just one API. Since you didn't say otherwise I assumed that your problem area was in communicating the information from each system to the computer doing the analysis. It now seems that you have not got that far and your problem is the more basic one of getting the information in the first place.
You need to first of all find all the drives on a system. The easiest approach here is to use FileSystemView.getFileSystemView().getRoots() but you need to understand the limitations.
Second you need to recursively traverse each root and build a list of all the files (File.listFiles()). This is likely to be a very slow process since it has to visit and list the content of every directory. Of course here you will run into security problems since on Windows this may need to run as Administrator and on *nix this will have to run a 'root' . Since one should never run as Administrator or 'root' unless it is absolutely necessary this is the start of the security nightmare.
Finally you need to sent the information back for the report generation. I dealt with possible approaches to that earlier but this is likely to be a very very big security issue.
You may think me perverse but I really do find it difficult to understand the rationale for what you are doing and if you are a professional you should be communicating any reservations back to the people who have given you the requirement and not just implementing whatever they throw at you.
- 12-12-2012, 11:27 AM #13
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,424
- Blog Entries
- 7
- Rep Power
- 17
Re: How to get details of drives of system over LAN via IP address
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-13-2012, 07:28 AM #14
Re: How to get details of drives of system over LAN via IP address
Josah,
I didn't mean to have an such program that returns everything in one go. I just wanted to discuss the things with different minds that how best i can write the program for the same. And i have an program/API that gives the information about the local system.
AndJava Code:File[] roots = File.listRoots(); for(int i=0;i<roots.length;i++) System.out.println("Root["+i+"]:" + roots[i]);
I think you can better understand now.Java Code:File file = new File("C:\\"); if (!file.exists() || !file.isDirectory()) { System.out.println("Parameter is not a directory"); System.exit(1); } File[] fileArray = file.listFiles(); for (int i = 0; i < fileArray.length; i++) { if (fileArray[i].isDirectory()) { System.out.println("- " + fileArray[i].getName()); } else { System.out.println(fileArray[i].getName()); } }sanjeev,संजीव
- 12-13-2012, 07:33 AM #15
Similar Threads
-
How to get list of mounted drives?
By Shellback3 in forum New To JavaReplies: 1Last Post: 12-19-2011, 06:15 PM -
Get Ip address and OS name of system in a network
By christhuraj in forum NetworkingReplies: 1Last Post: 03-29-2011, 04:39 PM -
Ho to add usedspace for all drives
By Ajitha in forum New To JavaReplies: 1Last Post: 05-30-2010, 03:30 PM -
Recognize HDD, CD/ROM, DVD/ROM drives
By xmikul28 in forum Advanced JavaReplies: 3Last Post: 08-25-2009, 01:27 PM -
Listing Logical Drives
By Juggler in forum New To JavaReplies: 3Last Post: 08-10-2008, 07:08 AM


2Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks