Files under each child folder

hi all,
i want to write a program which will list all files under each folder in the structure e.g
c:\1xml\1.html
c:\1xml\hello\hello.java
c:\1xml\hello\hi\file.xml
etc
following codes only shows me one level.
can any one hint me to resolve this issue?
String dirName = "C:\\1xml";File dir = new File(dirName);System.out.println(dir.getAbsolutePath());if(!dir.isDirectory()) {      System.out.println("File: " + dir.getName() + " is not a valid directory" );} else {      File[] allFiles = dir.listFiles(); for (int i = 0; i < allFiles.length; i++) {      String s = allFiles[i].getName(); System.out.println("File: " + s + " found");}

i have put the code tag..can u help?
thanks,
/s
c:\1xml\1.html
c:\1xml\hello\hello.java
c:\1xml\hello\hi\file.xml
etc
following codes only shows me one level.
can any one hint me to resolve this issue?
<pre>
String dirName = "C:\\1xml";File dir = new File(dirName);System.out.println(dir.getAbsolutePath());if(!dir.isDirectory()) { System.out.println("File: " + dir.getName() + " is not a valid directory" );} else { File[] allFiles = dir.listFiles(); for (int i = 0; i < allFiles.length; i++) { String s = allFiles.getName(); System.out.println("File: " + s + " found");}
</pre>

Similar Messages

  • ITunes creating duplicate files under a hidden folder named "Volumes".

    It seems my iTunes program is secretly making a duplicate file in a hidden folder called "Volumes" on my laptop hard drive. It's now maxxed out my drive and I need to both remove the "Volumes" folder and make sure it doesn't get created and happen again.
    Details:
    Using a Powerbook G4 with an 80gb drive. Using iTunes 8. The iTunes library program is in the usual place on the lap top hard drive but the music library folder, where all the files get saved to, is on an external drive labeled "Media".
    Clicking normally and searching around my laptop hard drive, I do not see or am able to access the folder named "Volumes". But I know it exists as I ran a scan program called jdiscreport and it clearly shows a huge folder, 45gb, named "Volumes". There are also a few old flacs in the "Volume folder also. The iTunes duplicate files are in identically named folders as the external drive: iTunes Music located within Media, located within Volumes.
    When I rip a CD in iTunes (or the iTunes-LAME program I sometimes use), the files do go to the proper external folder as expected and as I've set in the iTunes preferences section. So why is iTunes also saving the same thing to this mystery "Volumes" folder on the lap top hard drive? How do I get rid of this folder without wiping my drive? How do I stop it from continuing?
    Help, I have 2gb of free space left!
    Thanks, James

    Hi I am having a similar issue, It all started when I tried to restore from the Time Machine and it threw a error back stating that there is no disk available. I was wondering how come and went to find out what is happening and was shocked to find out that actually my entire Macintosh HD has a duplicate copy inside the /Volumes folder. I went to the XTERM to investigate and found that the / (root) has a Users folder where all my stuffs like pictures, music, movies, documents reside and the same data or content is duplicated in the /Volumes/Macintosh HD/Users folder
    I first thought that it was only a link, but I later found that it is not a link and it is indeed a physical copy of all my User folders inside the /Volumes/Macintosh HD/Users folder and actually occupying my Hard disk space.
    I am not sure how this happened or how it is duplicating itself. I am also afraid to delete the stuffs inside the /Volumes folder as it might crash my system (it is already hidden - I assume it is hidden for some purpose). Please suggest any options, how I can get rid of these duplicated data and how to avoid such duplication in the future.
    Thanks
    Regards
    Chelvam.S.T

  • Can not create a file under \window\system32 folder

    How do I create a folder in \windows\system32 in x64 machine through java code?
    Creating a file/folder under \windows\system32 fails and java creates a folder in \windows\syswow64 folder.
    pls see the code attached for example.
    My client wants to create a folder using my application.
    I dont want to use any native code suggested by microsoft. You can see in the following link
    http://msdn2.microsoft.com/en-us/library/aa365743(VS.85).aspx
    import java.io.*;
    public class FileTest{
         FileTest(){
              boolean created = writeFile();
              if (created)
                   System.out.println("File Created Successfully");
              else
                   System.out.println("Could not able to create the file");
         public static void main (String args[]){
              FileTest ft = new FileTest();
         public boolean writeFile(){
              try{
              Writer output = null;
              String text = "Sample Test File";
              if(!(new File("c:\\windows\\system32\\customFIle").exists())){
                   new File("c:\\windows\\system32\\customFIle").mkdirs();
              File file = new File("c:\\windows\\system32\\customFIle\\write.txt");
              output = new BufferedWriter(new FileWriter(file));
              output.write(text);
              output.close();
              return true;
              }catch(IOException ioex){
                   System.out.println(ioex);
              return false;
    Thanks in advance

    java_mani wrote:
    How do I create a folder in \windows\system32 in x64 machine through java code?Can the user that executes this Java code create "manually" a folder in that directory?
    Creating a file/folder under \windows\system32 fails and java creates a folder in \windows\syswow64 folder.
    pls see the code attached for example.
    My client wants to create a folder using my application.
    I dont want to use any native code suggested by microsoft. You can see in the following link
    http://msdn2.microsoft.com/en-us/library/aa365743(VS.85).aspx
    Why not?

  • Ran Security Update 2015-002 Version 1.0 now I cant find my apps or view files under my home folder

    I just updated my system with the Security Update 2015-002 and now I cant find any of my applications that were located in my applications folders, even when I go to the folder with my name it will not show any folders. Where did all my stuff go?

    Permission Issues - Troubleshooting
    You may need to rebuild permissions on your user account. To do this,boot to your Recovery partition (holding down the Command and R keys while booting) and open Terminal from the Utilities menu. In Terminal, type:  ‘resetpassword’ (without the ’s), hit return, and select the admin user. You are not going to reset your password. Click on the icon for your Macs hard drive at the top. From the drop down below it select the user account which is having issues. At the bottom of the window, you'll see an area labeled Restore Home Directory Permissions and ACLs. Click the reset button there. The process takes a few minutes. When complete, restart.   
    Repair User Permissions

  • Query Count files under Specific folder in Sccm?

    Hello!
    I try to create a Query in sccm. There I want to count files under a specific folder. If folder on the client have less than 35 files, show the name of that computer. How should I begin to create that Query? Should I use criteria Software files Count?
    Greetings
    Emil

    I think for this task you will find it easier to create a report instead. Queries are based on WQL which has some limitations.
    Kent Agerlund | My blogs: blog.coretech.dk/kea and
    SCUG.dk/ | Twitter:
    @Agerlund | Linkedin: Kent Agerlund |
    Mastering ConfigMgr 2012 The Fundamentals

  • How To traverse files under subfolder using Traverse folder option

    My files are stored as Newborn.txt under each year's subfolder, How to implement this.
    Eg: C:\Ravi\N90\Newborn.txt
      C:\Ravi\N91\Newborn.txt
    C:\Ravi\N92\Newborn.txt
    C:\Ravi\N93\Newborn.txt
    Pl help me to read the files using the for each loop container"

    Set the folder location as C:\Ravi inside for each loop
    Select the traverse subfolders option and it will iterate through all subfolders in it
    set file type as *.txt and it will iterate through above listed files one by one
    also see
    http://www.sql-programmers.com/for-each-loop-container.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to write content of the file under folder

    Hi Experts,
    I have following scenario, I have list of files under folder in local desktop(for eg D:\mani)
    I have only filename, using this filename i want to search and get content of the particular file and write in some other location? how to do that? give your suggestions?
    Regards,
    P.Manivannan

    You could go two ways here:
    The first possibility requires that (a) you know what operating system you are working with, and (b) you only need to copy the file, and not do anything else with the contents of it. In this case, probably the easiest way to do this is to use a Runtime exec command for the file you want to copy:
    java.lang.Runtime.getRuntime().exec( "cp D:\mani D:\mani2" );Otherwise, if you need your code to be portable, you can't assume anything about the operating system. Since java.io.File doesn't provide a copy method, you will need to read the entire contents of the file into the vm, and then write them out to a new file. Also, if you need to use the contents of your file in some other way, as well, then you also need to read the entire contents into the vm. In this second case, how you read the file may depend on what kind of data the file contains.
    In general, the following code should work for you:
    final FileInputSteam  fis = new FileInputStream ( new File( "D:\mani"  ) );
    final FileOutputStream fos = new FileOutputStream( new File( "D:\mani2" ) );
    final byte [] buf = new byte[ 1024 ];
    int bytesRead;
    while ( ( bytesRead = fis.read( buf ) ) != 0 )
        fos.write( buf, 0, bytesRead );Don't forget to catch or throw IOException.
    Hope this helps.
    - Adam

  • When saving files under options the file name is duplicated how to remove extra folder with the same name

    Under Firefox Options I clicked Saving Files under Downloads but the file name appears twice and an extra folder with the same name is created within the folder i.e.:
    G:\Akbar's Songs\HAMARA FORUMS DOWNLOADS\HAMARA FORUMS DOWNLOADS
    As you can see the folder is repeated, how can I correct this?
    Also the music files I download from a site downloads as WinRar file and I need to open it. Is there an option where the files open automatically in the folder I have selected?
    Many thanks for your help.

    The "beta" version is for testing and may be more prone to problems, so I suggest trying the regular version (9.20) even though it hasn't been updated since 2010.

  • Download list button in upper right corner hinds under "Reader" button? Unable to find down loaded file in the download folder afterward?

    The Download list button in upper right corner of screen hides under "Reader" button?   Does not show down loaded(?) file in the download folder afterward?
    Trying to run a brokerage firm streaming quote app with java.  Wondering if I may have deactivated the Download list button some how?

    Hey Sgt.Rics,
    It sounds like you're experiencing some unexpected behavior in Safari, specifically the window layout blocking the Downloads button. I would check and make sure no third-party add-ons are causing the issue:
    Safari: Unsupported third-party add-ons may cause Safari to unexpectedly quit or have performance issues
    http://support.apple.com/kb/TS3230
    Welcome to Apple Support Communities!
    Take care,
    Delgadoh

  • Service file under template folder missing

    Hai,
    We have installed ITS 6.2 in  a machine.  The templates folder of AGATE does not have service files like BWSP, PZ transaction.
    I think after installation standard service files should be in templates folder. Correct me if i am wrong.  Is there any procedure for the Basis team to publish the all the service after installation. .
    Please let me know what is the procedure(or configuration) which basis has to do to publish all service files provided by SAP.
    Thanks & Regards,
    H.K.Hayath Basha.

    Hai,
    We have another ITS 6.2 server also in which the templates for the service files are under templates folder for example:
    D:\Program Files\SAP\ITS\Development\Template
    Under this templates we have folders with name BWSP, PZ01, PZ02...
    We have another new installation of ITS 6.2 patch 26 in another machine, the folder structure is
    D:\Program Files\SAP\ITS\Development\Template
    Under this template folder I am not able to see folders like BWSP, PZ01, PZ02.
    I am development consultant, in the previous installation I don't know what Basis did to publish the templates for BWSP, PZ01 and PZ02 under the path,
    D:\Program Files\SAP\ITS\Development\Template
    In the new installation my Basis team member doesn't know what the earlier team member has done to publish the templates for service files.
    Please let me know what is the procedure to publish the service file as templates in ITS server.
    Thanks & Regards,
    H.K.Hayath Basha.
    Service files in the templates folder? For sure, you can make this, but
    I would recommend to use the correct folder. The structure of the ITS folders
    has not been changed, as far as I know.
    Another good idea: Read the documentation or use your preferred search method
    for finding files like webgui.srvc

  • Each time I reopen a folder the files get rearranged alphabetically, how do I stop this so the file arrangement in the folder stays the same?

    Each time I reopen a folder in OS X 10.8.4 the files get rearranged alphabetically, how do I stop this so the file arrangement in the folder stays the same?

    I might add that all the files are aliases. There are 40 altogether and I am aware I could create 10 sub-folders so I only have 4 aliases in each subfolder which would mean I only have to rearrange 4 aliases each time but this is still not ideal. I have been using Macs since the 1980's and up to now files have always stayed where you put them unless you selected Arrange By in the Finder View Menu.

  • How can I make a PDF file from each folders with layers, where each page is a each folder?

    How can I make a PDF file from each folders with layers, where each page is a each folder?

    I found an answer to my own question. A work around of sorts.
    Download Photoshop Elements 6 for Macintosh. With PSE6 I made a slide show with 550 images 1920x1200, without thumbs. I ran into one problem making the slide show. My images contained 4 images which had not ben created by Photoshop and could not be included in the slide show. Opening the images in Photoshop CS4 and re-saving them still did not make then acceptable. Not a big deal. I probably could have fixed the four images by stripping all EXIF data before opening them in Photoshop. BTW, PSE6 made the slide show in demo mode.
    I hope the bug in Photoshop CS4 will be fixed in Photoshop CS5.

  • Popularity trend/usage report is not working in sp2013. Data was not being processed to EVENT STORE folder which was present under the Analytics_GUID folder.

    Hi
     I am working in a sharepoint migration project. We have migrated one SharePoint project from moss2007 to sp2013. Issue is when we are clicking on Popularity trend > usage report,  it is throwing an error.
    Issue: The data was not being processed to EVENT STORE folder which was present under the
    Analytics_GUID folder. Also data was not present in the Analytical Store database.
    In log viewer I have found the bellow error.
    HIGH -
    SearchServiceApplicationProxy::GetAnalyticsEventTypeDefinitions--Error occured: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly
    secured fault was received from the other party.
    UNEXPECTED - System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail,
    System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: We're sorry, we weren't able to complete the operation, please try again in a few minutes.
    HIGH - Getting Error Message for Exception System.Web.HttpUnhandledException
    (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party.
    CRITICAL - A failure was reported when trying to invoke a service application:
    EndpointFailure Process Name: w3wp Process ID: 13960 AppDomain Name: /LM/W3SVC/767692721/ROOT-1-130480636828071139 AppDomain ID: 2 Service Application Uri: urn:schemas-microsoft-
    UNEXPECTED - Could not retrieve analytics event definitions for
    https://XXX System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: We're sorry, we weren't able to complete the operation, please try again in a few minutes.
    UNEXPECTED - System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail,
    System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: We're sorry, we weren't able to complete the operation, please try again in a few minutes.
    I have verified few things in server which are mentioned below
    Two timer jobs (Microsoft SharePoint Foundation Usage Data Processing, Microsoft SharePoint Foundation Usage Data Import) are running fine.
    APPFabric Caching service has been started.
    Analytics_GUID folder has been
    shared with
    WSS_ADMIN_WPG and WSS_WPG and Read/Write access was granted
    .usage files are getting created and also the temporary(.tmp) file has been created.
    uasage  logging database for uasage data being transported. The data is available.
    Please provide pointers on what needs to be done.

    Hi Nabhendu,
    According to your description, my understanding is that you could not use popularity trend after you migrated SharePoint 2007 to SharePoint 2013.
    In SharePoint 2013, the analytics functionality is a part of the search component. There is an article for troubleshooting SharePoint 2013 Web Analytics, please take a look at:
    Troubleshooting SharePoint 2013 Web Analytics
    http://blog.fpweb.net/troubleshooting-sharepoint-2013-web-analytics/#.U8NyA_kabp4
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • My ISP is telling me that iWeb is putting my files in the wrong folder?

    First time trying to publish a website! I am trying to upload my iWeb site files via FTP from a folder that was created by iWeb. My ISP is telling me that the files are being uploaded, but to a sun folder that is not the root directory. They have pushed me back to Apple to resolve. Any help would be apprecited.

    Hello,
    I not sure I understand your problem.
    Are you using the "Publish to a Folder…" command to publish into a site that you connected to with the Finder opening a FTP site?
    I assume the server in question is a Sun server.
    Until I get the answer to my question, let me point out a one thing that could be your problem.
    When iWeb publishes a site, it places into a folder (directory) named to match the name of the web site in iWeb. I referring to the first name in the left column. It defaults to "Site". But, iWeb does put an index.html file in the same folder, which should point web browsers directly into your web site.
    You can remove the contents of the folder and pull it up to the same level with any problem. So, everything in the "Site" folder would be placed at the same level as the "Site" folder.
    By the way, there is a reason for iWeb publishing into a subfolder, because can have multiple web sites in one file. Each site has its own folder.

  • HT203200 Cannot delete the file from the itunes folder

    I cannont delete the file from the itunes folder because it tells me I need permission to do so.  I am the admin person for the laptop plus I have checked my permissions under the security tab in the files properties.  How do I delete this file to start again?  It downloaded 1.2GB of the file before the error message appeared, so its paid for and all but not looking like I'll get to watch it before the time runs out on the movie being available for me to watch. :-(

    Try deleting the file without iTunes running.
    When you next open iTunes it should then be marked as a missing file and you should be able to delete the entry from iTunes.
    Hope this works
    Regards,
    Colin R.

Maybe you are looking for

  • Spry Menu going wrong in Internet Explorer

    Hi all, I'm new to these forums, and new to web design. I added a horizontal spry menu in for my dads art website, it worked fine in Firefox 3.6 and Google Chrome, but Internet Explorer 7 or 8, I'm not sure which version, a recent one anyway. The men

  • Can I configure a Raid 5 disc through my mac

    I'm planning to buy a NAS and wanted to configure RAID 5. Does OS X have a built in configurator application?

  • How to develop a Chart from Actions button of an Interactive Report ???????

    Hi I am trying to implement a chart from Actions button of an Interactive Report through frond end. I am getting the Flash Security error for this. I know we have to change the HOST variable for this. But i am not sure where exactly I do this. For a

  • Slow cd import

    I am having loads of problems and I can't seem to resolve them.  I'm not very tech minded so I would love some straight forward help.  My system is Windows Vista and I am using version 10.5.1.42 I have two issues 1. Importing CD is so slow - at least

  • Os x 10.4.11 to os x 10.5, os x 10.4.11 to os x 10.5

    os x 10.4.11 to os x 10.5, os x 10.4.11 to os x 10.5?