Finding drives of computer using java

Hello All,
I am writing "explorer" using java . I am unable to find API that will
let me find the drives of a pc. E.x :- c:\ d:\ etc...
A computer can have any number of drives .
Please tell me what I should do.
Any help will be appreciated. Thanks in advance
sameer

Try the listRoots method in java.io.File .

Similar Messages

  • Shutdown computer using java?

    is it possible to shutdown or restart computer using java?if yes, is it an easy code?

    naruto8 wrote:
    i haven't tried it yet but i saw it in a forum from some site, it's using shell...
    don't worry i'll try it..
    i thought people here are nice so i try to ask question and it's actually answered most of the time...
    by the way, with my question, a simple YES or NO would be fine!!!You might think we're being rude, but that's not the case. For a great number of questions people ask here, the far better approach would be to use a search engine. For simple "how do I do this?"-type questions, it would take you a matter of seconds to find an answer on Google, compared with possibly hours, possibly not even getting an answer at all, asking here. Being able to do this yourself is an invaluable skill that all programmers should have. Writing software is difficult, and you'll hit loads of problems along the way. Imagine how long it would take you to solve them if you waited for an answer on a forum for them all. The forums are a better resource for when you've tried something, and simply can't work out why it doesn't work, that sort of thing. For API calls (Java or otherwise) documentation and the like, asking a forum is the least effective way of you getting an answer to your question

  • What is "owner-pc-vaio". its in my shared column in Finder. would another computer using my wifi show up in the shared column?

    what is "owner-pc-vaio". its in my shared column in Finder. would another computer using my wifi show up in the shared column?

    If you're in a hotel, school, or someplace with public WiFi access, you'll see a list of all other computers on the network. 
    As opposed to the answers above, with or without sharing on, you will see others on the network and they can see you.  As long as you have sharing off, and even then, they'd not have unrestricted acces unless you disabled all password access, they can see you but they can't do anything.
    If you're on your own private network, someone is stealing your bandwidth.  Since it's a piece of junk Windows computer, you can find out how to send them a nasty virus over a LAN. 

  • How to find Free disk space using Java program ?

    Hi friends,
    I need to find out the Free Hard disk Space to alert the user and send them mail if hard drive is about 85% full.
    i am developing databackup program in which i have to check it , if hard drive is fulled with 85% or remain left space is less email sent to user to notify and delete older backups.
    give me solution using java program...
    please
    Help me i need it in recent...

    Hi friends,
    I need to find out the Free Hard disk Space to alert
    the user and send them mail if hard drive is about
    85% full.
    i am developing databackup program in which i have to
    check it , if hard drive is fulled with 85% or remain
    left space is less email sent to user to notify and
    delete older backups.
    give me solution using java program...
    please
    Help me i need it in recent...

  • Access Windows Drive from UNIX using Java

    Does anyone know if you can access a windows share from a unix machine using Java?
    What options are available? Would a samba client have to be installed on the UNIX server first?

    mdreelin wrote:
    Does anyone know if you can access a windows share from a unix machine using Java?If your operating system can see the file system, I don't see why it wouldn't be available to Java.
    What options are available? Would a samba client have to be installed on the UNIX server first?Well you'd have to do something like that, otherwise you'd have to remote it via RMI or something (not recommended).

  • Can't find class when i use java.awt.Panel

    I got a Pocket PC with CE 3.0
    I made my first PJava application just a few hours ago. And it works fine. But when i introduce a Panel to improve the interface then application fails on the Pocket PC with the error message "could not find class application". When i remove the Panel it works fine again.
    I thought that java.awt.* is part of PJava. And even if not i should be able to introduce even a java.lang.* class to the PJava application if i use the JAR.
    Any suggestion?

    you should provide more detail about your deployment procedures.
    There are many ways to get this message. AWT in fact is part of pJava and works fine for most of us. So I assume the deployment is the problem. Have you checked the actual content of the JAR? Have you provided a path statement? How do you call your app (shortcut?)

  • Find current host name using Java

    I am running currently on Oracle 9i app server in a clustered environment. My application has business logic that needs current host name. How can I find out the host name without externalising(like properties file) the information. Is there a java api like
    .getHostName()
    Rama

    try this:
    import java.net.InetAddress;
    public class Foo {
        public static String getLocalhostName() {
            String hostName = "";
         try {
             InetAddress address =
              InetAddress.getLocalHost();
                hostName = address.getHostName();
            } catch (Exception e) {
                // error handle any which way you like
                e.printStackTrace (System.err);
            return hostName;
    }cheers,
    Georg.

  • Finding mail exchange addresses using java

    hi freinds,
    how to retrive the mx records by querying the DNS server.
    thanx in advance

    I have never used it, but here is a package of GPL classes for DNS resolution in 100% pure java.
    http://sourceforge.net/projects/jdns/

  • Is it possible to shutdown the computer using java?

    If any of you knows, please tell me thanks!

    Anione who can answer me with an example will get 10 Duke Dollars. plssss.... tell me...

  • Flash programming using Java!

    I found there are tools to compile .net applications to SWF movies that can be run by Flash.
    Are there any similar tools for Java, which can compile Java programs into SWF files?
    Looking for a way to write my Flash movies using Java...
    Thanks :)

    see if this is useful
    http://www.anotherbigidea.com/javaswf/
    Thanks, but I wanted to find a way to use Java syntax instead of Actionscript syntax when programming SWF files...
    Basically a compiler similar to javac, but which produces swf binaries instead of .class binaries.

  • Need help with Socket prog using Java wireless toolkit

    Hi, I am not able to communicate between client (Palm emulator) and server (Java on computer) using Java Wireless toolkit.
    Can anyone please tell me a site that shows an example. I have seen a bunch of examples but they all run by importing com.sun.kjava which seems to have vanished into thin air. So I cannot run them. Someone please show me some lines of code that will send just one character from client Palm emulator to server. thanks.
    Syed

    hi,
    I hope that you already have the J2ME Toolkit and that your emulator works okay. In the toolkit you get several examples to show you how to program a MIDlet. One has to do with a HTTP client server connection. Also in the API documentation for the J2ME there is a Connector class that you used to set up this communication and in the description of this class it pretty thoroughly explains how to set up an HTTP protocol client.
    However, if you want to do some other kind of networking then you are pretty much out of luck, as the TCPIP socket protocol has not been fully implemented and is optional to the J2ME specifications, only the HTTP protocol is certain to be available. This means that mobile phone companies can add other networking functionality to their phone's java virtual machine if they feel like it. This is a bummer I know.
    I hope this helps.
    Cheers,
    Mark

  • How to find cd rom drive in windows and unix platform using java program

    Hi,
    I am having the requirement of finding the cd rom drive
    using java program. I do not know the label and which
    one is the cd rom drive. also I want to know how many
    cd rom drives are there on my system. I want the solution
    for windows and unix platforms.
    If have any suggestions please mail to [email protected]
    Deepak

    Ughhh.. I had the same problem with multi platform file-system detection
    First off - Unix.
    Do you know for sure you have all your drives mounted?? This could be a big problem because java will not see unmounted drives... So you can scour thru your /etc/fstab to find out which drives are available... or you can mount all and show roots... (Yuck!)... You've got timeouts and all sorts of things to worry about...
    I would then shy away from the java.io.File.listRoots() on unix and rely on parsing your fs file. If a user would like to see the medium in the drive. Do a Runtime.exec and mount the drive, then you can grab the filesystem by wrapping it in the java.io.File object. ( NOTE - this will hold well for your NFS mounts as well which might be buried under other FS. So you now have detection for that as well. ) Labels are also noted in this file. Let me know if you don't know the difference between mtab and fstab....
    Second - Winders.... Corney but I love saying that.
    The listRoots is a good solution. As others have said CD-ROMS will not be writable. Use a combination of getName and getPath to decipher the label and mount point.
    Hope this helps!

  • My MacBook Pro stated that it needed to be updated. I clicked yes to restart the computer and update but when it restarted it stays on the gray screen with the apple logo and then pops up, stating "unable to find driver for this platform." What do I do?

    My MacBook Pro stated that it needed to be updated. I clicked yes to restart the computer and update but when it restarted it stays on the gray screen with the apple logo and then pops up, stating "unable to find driver for this platform." What do I do?

    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with networks that require any kind of authentication other than a WPA or WPA2 Personal password.
    When the Mac OS X Utilities screen appears, follow the prompts to reinstall the Mac OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac didn’t ship with Lion, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.
    Don't install the Thunderbolt update -- it's defective.

  • How to run java on computer without java from flash drive

    Im running a chess club at school and the school computers, you aren't allowed to install on the hard drive.
    Is there a way to put an ide and the java folder containing the jre and jdk on a flashdrive and run the ide and run programs solely from the lfashdrive?

    Yes. put the JDK (not the separate JRE) on the flash drive. The JDK contains a JRE.
    Plug the flashdrive into a computer you control. If that computer already has the desired JDK installed, copy the JDK directory (all of it) to the flash drive. Otherwise, do an install of the JDK to the flash drive.
    To run Java application programs use a command that provides the full path to the java.exe program, for instance (in Windows)
    *<drive letter>:\<some directories>java <the name of your program>*
    You could create a bat file to make this easier to type.
    You can't run applets or anything else that depends on Registry entries.

  • I need serious help! 'computer is unable to find driver for this platform'

    i was just manually upgrading my OS X 10.4.7 mac mini to OS X 10.4.9 when halfway through the upgrade installation the computer froze and i had to reset it.
    now everytime i turn on the computer it comes up with an error message saying:
    panic(cpu 0 caller 0x0039C213): Unable to find driver for this platform: "ACPI"
    the only option it gives me is to restart the computer which doesn't help.
    can anyone please tell me how i can fix this?

    Well. I think you have only two option left:
    Archive and Install: will re-install OS X preserving users and files.
    Re-install 10.4.9 Combo Update: In order to do this, you either need another Mac running Tiger and capable of starting in FireWire Target Disk Mode and a FireWire cable, or an external bootable HD.
    If you have another Mac that supports FireWire Target Disk Mode, you can proceed as follows:
    In the working Mac (the Target machine) download the appropriate 10.4.9 Combo Update (PPC or Intel). Leave it on the Desktop. Do not run it.
    Follow the steps of this article.
    Once your Mini has booted from the Target machine disk, run the 10.4.9 Combo Update, selecting as the destination of the install the Mini's Hard Drive.
    If you have a bootable external Hard Drive, (with OS X installed on it) boot from it (hold the Option key at startup), download the Combo Update and install it to the internal HD.
    If you don't have a bootable external HD, you can still re-install the Combo Update booting from the Tiger install disk, and using an USB thumb drive (sometimes it may need to be formatted as HFS), following this cumbersome procedure.
    Good Luck.

Maybe you are looking for