Results 1 to 15 of 15
Like Tree2Likes
  • 1 Post By sabre150
  • 1 Post By sabre150

Thread: How to get details of drives of system over LAN via IP address

  1. #1
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default How to get details of drives of system over LAN via IP address

    Hello All,

    I need to get all drives details of a system over the LAN, i have an program that gives the localhost's system details like all drives and files and folders within localhost system.

    Thanks,
    Sanjeev
    sanjeev,संजीव

  2. #2
    sabre150 is offline Member
    Join Date
    Jul 2012
    Location
    Earth
    Posts
    75
    Rep Power
    0

    Default 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.
    DarrylBurke likes this.

  3. #3
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default 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,संजीव

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default 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.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by DarrylBurke View Post
    I think you missed sabre150's point. Also, you didn't answer his question.

    db
    I need to generate a report that shows all the files on all the machines that are connected to LAN.
    sanjeev,संजीव

  6. #6
    sabre150 is offline Member
    Join Date
    Jul 2012
    Location
    Earth
    Posts
    75
    Rep Power
    0

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sanjeevtarar View Post
    Hello,

    Thanks for your reply, the owners will allow to see the information.
    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.

  7. #7
    sabre150 is offline Member
    Join Date
    Jul 2012
    Location
    Earth
    Posts
    75
    Rep Power
    0

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sanjeevtarar View Post
    I need to generate a report that shows all the files on all the machines that are connected to LAN.
    So each day/week/month someone is going to have to go though the report looking for err... what? I'm glad I don't work for your company.
    DarrylBurke likes this.

  8. #8
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sabre150 View Post
    So each day/week/month someone is going to have to go though the report looking for err... what? I'm glad I don't work for your company.
    Instead of discussing nontechnical things can i have any idea if you have, please.
    sanjeev,संजीव

  9. #9
    sabre150 is offline Member
    Join Date
    Jul 2012
    Location
    Earth
    Posts
    75
    Rep Power
    0

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sanjeevtarar View Post
    Instead of discussing nontechnical things can i have any idea if you have, please.
    Err ... I have given you two technical solutions! 'Discussion' is a two way process and you have not commented on my technical solutions so from my point of view there is nothing technical to discuss.
    Last edited by sabre150; 12-12-2012 at 08:58 AM.

  10. #10
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sabre150 View Post
    Err ... I have given you two technical solutions!
    I think you have not provided the solutions instead you provided the points/alternative ways to do this.....i want to know how to do this. Some API guide to do this.
    sanjeev,संजीव

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default 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
    sabre150 is offline Member
    Join Date
    Jul 2012
    Location
    Earth
    Posts
    75
    Rep Power
    0

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sanjeevtarar View Post
    I think you have not provided the solutions instead you provided the points/alternative ways to do this.....i want to know how to do this. Some API guide to do this.
    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.

  13. #13
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,998
    Blog Entries
    7
    Rep Power
    19

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by Tolls View Post
    It's not something that a normal setup actually uses, so is unlikely to be found in an existing API.
    Darn, so you're saying there is no giveMeAllInfoINeedFromAllDrivesFromAllSystemsYouCa nReach() method anywhere? What a disappointment Java is ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  14. #14
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by JosAH View Post
    Darn, so you're saying there is no giveMeAllInfoINeedFromAllDrivesFromAllSystemsYouCa nReach() method anywhere? What a disappointment Java is ...

    kind regards,

    Jos
    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.

    Java Code:
    File[] roots = File.listRoots();
    for(int i=0;i<roots.length;i++)
       System.out.println("Root["+i+"]:" + roots[i]);
    And

    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());
          }
    }
    I think you can better understand now.
    sanjeev,संजीव

  15. #15
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default Re: How to get details of drives of system over LAN via IP address

    Quote Originally Posted by sabre150 View Post
    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.
    Thanks for your details on API,

    "There can be any type of requirements in this industry and it is now necessary that everything that is developed like this goes in wrong directions".
    sanjeev,संजीव

Similar Threads

  1. How to get list of mounted drives?
    By Shellback3 in forum New To Java
    Replies: 1
    Last Post: 12-19-2011, 06:15 PM
  2. Get Ip address and OS name of system in a network
    By christhuraj in forum Networking
    Replies: 1
    Last Post: 03-29-2011, 04:39 PM
  3. Ho to add usedspace for all drives
    By Ajitha in forum New To Java
    Replies: 1
    Last Post: 05-30-2010, 03:30 PM
  4. Recognize HDD, CD/ROM, DVD/ROM drives
    By xmikul28 in forum Advanced Java
    Replies: 3
    Last Post: 08-25-2009, 01:27 PM
  5. Listing Logical Drives
    By Juggler in forum New To Java
    Replies: 3
    Last Post: 08-10-2008, 07:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •