How can I see what file's are in  a directory

I'm want to make a program for brosing the harddisk and copying and editing file's.
I already can copy them but:
How can I see what file's are in a directory and how can I see
what subdirectory's are in a directory so I can show them to the user?
I dont't know if it does matter if If I'm on a windows or linux platform, when it does please tell me for the windows?

I believe this works for a directory of reasonable size.
import java.io.File;
final public class FileSearch {
    public File current;
    public String path;
    public File[] files;
    public FileSearch(File dir){
       try {
          current = dir;
          files = dir.listFiles();
       } catch (Exception e) {
          e.printStackTrace();
    public void currentSearch() {
       for (int i=0; i<files.length; i++) {
          if (files.isFile()) {
System.out.println(files[i].toString());
public void searchFiles(){
for (int i=0; i<files.length; i++) {
if (files[i].isDirectory()) {
System.out.println();
System.out.print("directory: ");
System.out.println(files[i].toString());
try {
FileSearch sub = new FileSearch(files[i]);
sub.currentSearch();
sub.searchFiles();
sub= null;
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) {
try {
FileSearch search = new FileSearch(new File("."));
search.currentSearch();
search.searchFiles();
} catch (Exception e) {
e.printStackTrace();

Similar Messages

  • How can i see what email addresses are associated with my apple id

    I recently had an iphone 6 stolen and since it was someone who knew how to gain access to my personal information they were able to change passwords and such associated with my apple id which made it a nightmare. Along the way as i was speaking to an apple support tech, i was told that he was limited as to how helpful he could be because I was unable to provide an email address that the phone was associated with, though he could see that findmyiphone was on, he just couldnt share the info with me as to how i could find out what email or who the phone was currently registered to.  Can anyone please tell me the website for which i cant remember that will give me more access or more ifo if i enter all the emails that may be associated with the account.  I was given this at one point and now i cant find it or remember it.  thank you

    https://appleid.apple.com

  • How can I see the files that are attached to appointments in outlook

    I store files in my appointments in Outlook on my work server that contain travel details, meeting agendas etc. I need to be able to access these on my ipad yet I can't find any way of making them come across to iCal.

    You might want to review the Time Machine Tutorial, and perhaps browse Time Machine - Frequently Asked Questions.

  • How can i see the  files that  are  suppose to eb backed up on my time capsule

    I have   a  aple time  capsule, which  i think i  was able to back up my imac  on, but   i cannot  view  these  files,  all i get  when i go into the  time capsle  is liek a screen shot  of  finfer  ,   i cannot  find  actual  files  like my  music or  pictures in the  time capsule,  any  suggesions  be  fantastic, thankyou

    You might want to review the Time Machine Tutorial, and perhaps browse Time Machine - Frequently Asked Questions.

  • How can I see what devices are linked to my iCloud?

    how can I see what devices are linked to my iCloud?

    You can see which devices are currently set up and/or logged in by signing in at iCloud.com on your computer.  Then click the Settings icon or select your name from the top right, then select iCloud Settings. A list of devices using your account will be displayed.

  • How can i see what devices are connected to my icloud?

    I want to know if pictues from my mac are on any other devices. How can i see what other devices i have connected to my icloud?

    My brother asked me for my account one day but i don't know if he used it to connect icloud or to just download an app. I just want to see if his device is connected to my icloud and if so, i want to disconnect him. So is there any site or anything i can do to see what devices are connected?

  • HT2688 How can I see what computers are authorized to share?

    How can I see what computers are authorized to share? My e-mail address changed and I need to make sure one of my authorized computers is not my old address. In itunes.

    In order to see which devices are authorized on your account:
    Open iTunes
    Click Store
    Click Account
    Click View Account
    Enter your password
    Look in the second section iTunes in the Cloud
    To the far right you'll see Manage Devices
    Once it's clicked you will see all of the devices currently authorized in iTunes/on your account
    I was going to say, "Hope this helps," but based on the above, I'm pretty sure it did!
    Thanks guys...

  • How can I see what photos are stored on iCloud?

    How can I see what photos are stored on iCloud? I haven't used Photo Stream before so there are no photos on there that I can see.
    Help needed ASAP.
    Thanks

    If you haven't used Photostream there won't be any photos "actually on iCloud".
    Any photos stored as part of an iOS device backup can be viewed on the iOS device after restoring the backup to the iOS device. They can't be viewed online.

  • How can I tell what files are in Workspaces?

    The email notice says to download your Workspaces files - before Jan 6, 2015. How can I tell what files I have in Workspaces?

    See
    FAQ: Adobe Workspaces is being retired
    Sign in | Acrobat.com - Workspaces

  • HT2531 How can I see a file's enclosing folder.

    Often I just need to know where a file is, not to open it.  If I go to Spotlight, how can I see what its enclosing folder is?  I think this used to pop up when hovering over a file name in Spotlight. 
    Thankyou.

    If you are talking about the spotlight search in the upper right of the finder window it still has the tooltip that shows you the full pathname of what you are pointing at in the list.
    If you select spotlights show all then the pathname is outlined at the bottom of the spotlight window and you can double click any of the items along that path to open that item.

  • How can I see what is on my cloud?

    How can I see what is on my cloud? Also, I keep getting asked to manage storage when I am watching videos that I have bought through the store. I have bought lots of cloud space only half of which is used. Is my device too full of pictures or videos and how do I know if they are on the cloud or stored on the I tunes store where I bought them from?

    Managing (iCloud Data) on Your iPad
    http://www.peachpit.com/articles/article.aspx?p=1899113
    How much space is used by your Other? You may be able to reduce.
    How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
    http://tinyurl.com/85w6xwn
    With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5/6/7, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
     Cheers, Tom

  • How can I see what is in iCloud ?

    How can I see what is in my iCloud?   ( This is so easy to do with Dropbox. )

    Hello Ziatron,
    Unfortunately, there is no simple answer to that question.
    - You could see how much of your storage space is currently used by opening System Preferences > iCloud > Manage...
    - If you want to see what files are currently stored in iCloud, I suggest to open the iCloud Drive app via a web browser at www.cloud.com.
    Best regards,
    David

  • My one year old macbook pro is full.  :  (   How can I see what's taking up all the GB?

    My one year old macbook pro is full already.  :  (   How can I see what's taking up all the space?  I cannot download anymore pictures.  It's running slower than usual.

    OmniDiskSweeper (free) - http://www.omnigroup.com/applications/omnidisksweeper/download/
    Archive files onto other media until your hard drive has at least 10% of its total size free, or at least 15+ GB at all times.

  • How can I see what has been backed up

    After doing a category BU to my WD Passport Ultra, how can I see what was backed up? The Smartware tells me that what I selected was done.But how and where can I confirm this? Thanksgrowlybear

    Simplest way is to open the drive in Windows Explorer, then in the root you should find a folder WD Smartware.stor. Within that should be a folder for each device you've backed up, and within that a folder for each drive on that device that you've backed up. Within those drive folders you should find the files/folders that have been backed up from that particular drive. You can look through them in the same way that you look through the files/folders on your actual drive itself, and confirm that everything is there that you expect to be.

  • HT204053 How can I see whats in my Icloud account

    How can I see whats in my icloud account

    You can see all of your data from within the apps on your device that are syncing with iCloud (contacts, calendars, reminders, notes, etc.).  You can also see some of it on icloud.com.
    To get an idea what is using your storage, go to Settings>iCloud>Storage & Backup>Manage Storage.

Maybe you are looking for

  • Webhosting on home computer not responding (sometimes)

    Using iWeb I published my personal website to my home computer, an iMac with i3 processor. Sometimes it works fine, but other times the website fails to open' because the server where this page is located isn't responding,'  I figure this is probably

  • Arranging 3 integers in ascending order

    i need the code for arranging 3 numbers in ascending order. the numbers will be typed in a input dialog box. someone please help! it's homework for tomorrow dec 16 2005.

  • How good is OS x as far as gaming compatibility?

    I have recently gotten into gaming on my old windows laptop, but the hardware just doesn't cut it.  I plan on getting a Macbook Pro, under or at $2,000, but the only thing holding me back is the gaming capabilities.  I play a lot of Valve games, but

  • How to remove Central Management Server in Lync 2013

    Hello, I want to know how can I manually remove the Central management Server in Lync 2013. I didn't see any information in the ADSEdit. Thanks, stmart

  • Ndiswrapper on 2.6.14-ARCH

    Hi, has anyone managed to make ndiswrapper work on the 2.6.14 kernel? Seems to me that the /lib/modules dir changed a bit with the new kernel or am i wrong?