Want to create a new folder in Windows using Java?

Hello everyone!!!
The situation is I want to create a folder using Java.
What I am doing is I am asking client to upload files.If the client is uploading for the first time a new folder is created on the server side and all the files related with that client will be uploaded in that folder only.Can anyone help me with the code.I am using html for letting client select the file to be uploaded and jsp to upload the file .The server I am using is Tomcat5.5 and OS is Windows Xp.
Please help me with the code or any alternate logic.
Thanks in advance.

create a java.io.File object for the path you'd like your directory to have and call .mkdir() on it (or mkdirs() if you need to create a hierarchy of directories).

Similar Messages

  • Creating a New Folder in Windows Registry by java coding

    Good morning,
    hi to all,
    how can I create a New folder in Window Registry using Java coding. Can anybody help me out pls.
    I begin waiting for ur reply.
    Thanx

    Why do you feel you need to write to the Windows registry directly? Take a look at the Preferences class.
    {color:#0000ff}http://java.sun.com/javase/6/docs/api/java/util/prefs/Preferences.html{color}
    luck, db

  • Create a new folder in windows from SAP

    Hi,
    I can execute progrmas from sapusing the WS_EXECUTE function, but how can I crete a new folder in windows from SAP?.
    Thnaks

    Hi,
    I have a idea about this problem.
    Firstly, I made a batch file. The file is a text file, so you can create easily the file from the WS_DOWNLOAD function. The file include a command - md (folder name).
    Secondarily, I executed the batch file by the function 'WS_EXECUTE'.
    Finally, I deleted the temporary file by the WS_FILE_DELETE function.
    It's easy.
    If do you need the source, you should send a mail to me.
    The source is given you.
    Best regards,
    Don

  • WHY CAN I NOT CREATE A NEW FOLDER IN WINDOWS 7

    I AM SURE THAT YOU (MR/MS ROBOT) HAVE FOUND A QUESTION SIMILAR TO MINE BECAUSE I HAVE ALSO FOUND A SIMILAR QUESTION SIMILAR TO MINE.  AND_AND I FOUND A SOULTION THAT RUNS FOR MANY PAGES ASKING ME TO COPY AND PASTE MULTIPLE ENTRIES TO POSSIBLY SOLVE
    THE ISSUE.  REALLY!!!!!!!DON'T YOU (WHO EVER YOU ARE) THINK THAT IT WOULD BE MORE EFFICIENT TO CORRECT THIS ISSUE FIXING CODE SINCE THIS ISSUE HAS BEEN GOING ON FOR SEVERAL YEARS?  OH, PLEASE EXCUSE ME YOUR MOST HONORABLE..........I ALWAYS SEEM TO
    FORGET THAT YOU ARE THE ALMIGHTY AND ARE ABOVE ALL..............LEST WE PEASANTS FORGET THAT WE ARE OF LOWER BEINGS AND MUST BOW DOWN TO THOSE WHO CONTROL!  PLEASE FORGIVE ME...................................................

    Hi,
    Based on my understanding, your issue is you cannot create folder in Windows 7, right?
    Did you fix it?
    This issue might be caused by corrupted system file.
    If I am right and you haven't resolve your issue, we could try the following method:
    Run System File Checker Tool to repair your system file:
    Use the System File Checker tool to repair missing or corrupted system files
    http://support.microsoft.com/kb/929833/en-us
    In addition, please refer to this helpful thread:
    http://social.technet.microsoft.com/Forums/windows/en-US/97de8a2a-12f2-4381-a409-a78f4ae551cf/cannot-create-new-folder-in-windows-7?forum=w7itprogeneral
    Karen Hu
    TechNet Community Support

  • I want to create a new folder on my external hard drive for photos.  Even though I added the new folder button to the tool bar it is not highlighted so I cannot click on it to create a new folder on this drive.

    I have an external hard drive that I would like to pre-make a new folder before I import photos into it.  Even though I added the new folder app to by toolbar, it is not highlighted and I cannot use it.  It will only let me create new folders if I upload to iPhoto.  That is not where I want to store everything.  So I need to figure out how to turn on or activate New Folder on my toolbar for all possible downloading options.

    If it's a drive that you've previously used with a PC, just double-check the format - click the drive once on the desktop to highlight it, and click cmd-i (the command key and the i key together) to see the Info window. That will tell you, under Format, how it's formatted.
    If it's "NTFS", that's the current Windows format. You can read but not write to it with a Mac. If you want full read/write access, you should look into Paragon NTFS, which allows you to do both. Note that some features of te Mac (Time Machine, for example) will only work with Mac-formatted drives.
    Matt

  • I want to create a Ajax based Chating application using java .

    hi . I want to create an chating Application , and ajax based chatting application using java as my server side language ..i have some idea about it .. but one thing that i m not understanding is that how i will communicate with other users because each user has its own session so what i will do to send one messge to all the users ???? . i m new to JavaEE and i have chosen this as my semester project .. i need some help regarding this .

    First get it working without AJAX.

  • Need help to create a new record in mdm using java webdynpro

    hi all,
    I have to develop an application to create a new record in mdm by using java WebDynpro  . Please help me what is the process that i have to follow to do this and provide me if you have any step by step guidance for this.
    thanks & regards,
    Mahi.

    Hi,
    The below link will help u to make the application in JAVA webdynpro
    The article has code to for creating records.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/803e9e80-21f4-2a10-8cbf-bcf6a8060be3
    Hope this may help u .
    Rgds
    Ankit

  • Creating a new folder sometimes drives me wonky

    Have any of you found a work around for this: When I'm in the hierarchical view in the finder and want to create a new folder in one of the panes, the OS can make it difficult. If the pane is completely filled with files or folders, when you control click to bring up the context menu, the OS assumes that you want to pick a choice dealing with whatever file you were hovering over at the time.
    In order to create a new folder in that pane, I either have to do something wonky like create the folder on the desktop and drag it in, or expand the window to get blank space at the bottom of the file list.
    Is there a way to create a folder directly in a filled pane?

    You can also right click on the top of a finder window choose customize from the contextual menu & drag the new folder icon to the top of the finder window.
    Also click on the action icon (gear icon) & choose new folder from the drop down menu.
    Message was edited by: Joe Salafia

  • How do i create a new folder in finder

    how do i create a newfolder in finder. whenever i click new folder it creates a new folder in whatever folder is highlighted. i need a new folder altogether.. also how do i give that folder a new icon

    The information below is in the Finder's Help menu. Your problem creating a new folder may be due to your not having the correct window activated.
    *Creating a folder*
    You can create folders to organize your files and applications.
    In a Finder window, open the location where you want to create the new folder.
    Choose File > New Folder.
    To give the folder a new name, select it, then click its current name. Type a name for the folder and press Return.
    If the New Folder command is dimmed, you do not have permission to create a folder inside the folder you opened.
    *Changing the icon of a file or folder*
    You can use custom icons for any file or folder in the Finder. You can create your own icons or download icons from websites on the Internet. Once you have custom images, you can replace icons for items.
    In the Finder, select a file whose icon you want to use.
    Choose File > Get Info.
    Click the icon in the Info window and choose Edit > Copy.
    Select the file whose icon you want to replace and choose File > Get Info.
    Select the icon in the Info window and choose Edit > Paste.

  • Creating a new folder in bookmarks

    I want to create a NEW folder in bookmarks and THEN add bookmarked pages to that folder.
    I've actually searched support for a specific solution or instructions and found none. Currently, I can not find any instructions or options for creating a folder. I don't want to just bookmark the current page I am on. I want to create a folder based on topic and then, later, add bookmarks to that folder when a particular page is related to that topic.
    How?

    Note that you can also create a new folder via the Organize button in the Library window.<br />
    The Organize is the first of the three buttons on the toolbar in the Library (Organize, Views, Import and Backup).

  • Create a new folder in sap r/3 main menu

    HI, i want to create a new folder into Material Management Module, this folder contain several transactions.
    What i need to do in order to sucess with this task?
    Thanks.
    Reward Points

    I try to do that, but i can't see the new folder
    The current system is not the original system of the menu
    Changes could be lost in future imports
    Addition remain
    And i choose Change.
    Expand the three in the position on Material Management and i choose insert as subnode and save
    But in the logon to the system (main menu) i cant see my folder
    Thanks

  • When I try to create a new folder I get an error code -50

    I am copying files to an external Hard drive.  I want to create a new folder on the external and I get an error code of -50 and no folder is created.  How do I clear the error code so I can create floders?

    The same thing happened to me: https://discussions.apple.com/message/25953748#25953748

  • Can I create a new folder with Js in ID?

    Hi,
    I want to create a new folder(not an exist folder) with JS in ID.
    Anyone can tell me how to do?
    Best Regards
    Goldbridge

    Goldbridge,
    I don't have time to check it, but f2, I think, should be a file path or a file object - not a folder object:
    fileObj.copy (target)
    target - A string with the URI path to the target location, or a File object that references
    the target location.
    Copies this objects referenced file to the specified target location. Resolves any aliases to find the source file. If a file exists at the target location, it is overwritten.
    So it should be:
    var myText = "save this";
    f1=new File("~/Desktop/images/1.txt");
    f1.open("w");
    f1.write(myText);
    f1.close();
    // I assume that aaa folder already exists
    f2=new Folder("~/Desktop/images/aaa");
    f1.copy("~/Desktop/Images/aaa/1.txt");
    Kasyan

  • I want to open a domain.site2 file outside the default folder (User/Library/Application Support/iWeb) with iWeb11, but iWeb only opens the domain file in the default folder. If I delete the default domain file, iWeb wants to create a new site. Help please

    I want to open a domain.site2 file outside the default folder (User/Library/Application Support/iWeb) with iWeb11, but iWeb only opens the domain file in the default folder. If I delete the default domain file, iWeb wants to create a new site. Does anyone have the same problem or know how to fix it?

    In Lion the Finder folder is now invisible.  To make it permanetely visible enter the following in the Terminal applicaiton window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    For opening your domain file in Lion for the first time or to switch between multiple domain files  Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an applicaiton.
    Just launch the applicaiton, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    OT

  • Creating a new folder in a SharePoint library using C# Windows Application.

    I have tried to create a folder within a SharePoint document library. The coding is as follows.
    Text Box Name: txtNewFolderName
    Button Name : btnCreateNewFolder
    private void btnCreateNewFolder_Click(object sender, EventArgs e)
    //String parameters for site URL and site name
    const string siteUrl = "http://thekingsbury/";
    const string siteName = "/SiteDirectory/thekingsbury/";
    //Freeze UI
    Cursor = Cursors.WaitCursor;
    btnCreateNewFolder.Enabled = false;
    //Use SPSite constructor to assign site collection based on top-level URL
    SPSite siteCollection = new SPSite(siteUrl);
    //Assign target site (SPWeb instance) based on site name
    SPWeb site = siteCollection.AllWebs[siteName];
    //Create an instance of SPDocumentLibrary based on the named doc library list
    SPDocumentLibrary docLibrary = (SPDocumentLibrary)site.Lists["Test Library"];
    //Create instance of SPFolderCollection and add a named folder based on forms input,
    //then update library to reflect added folder
    SPFolderCollection myFolders = site.Folders;
    myFolders.Add("http://thekingsbury/Test%20Library/" + txtNewFolderName.Text + "/");
    docLibrary.Update();
    //UI clean-up
    Cursor = Cursors.Default;
    btnCreateNewFolder.Enabled = true;
    Site URL :
    http://thekingsbury/
    Site Name: thekingsbury
    Document Library  : Test Library
    My problem is when I click the button it gives an error as the following.
    The Web application at http://thekingsbury/ could not be found.
    Verify that you have typed the URL correctly.
    If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
    The error shows at the following statement.
    "SPSite siteCollection = new SPSite(siteUrl);"
    I created both Windows & Web solutions and the result was the same.
    Note: I have add the reference to the SharePoint using the Microsoft.SharePoint.dll file. And used the "using Microsoft.SharePoint;" statement.
    Please can someone help me on this matter.It's a real paint to me.

    The complete solution using an InfoPath 2010 form is as the below.
    using Microsoft.Office.InfoPath;
    using System;
    using System.Xml;
    using System.Xml.XPath;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Client;
    using Microsoft.SharePoint.Linq;
    namespace Create_Folder_In_SharePoint_Library
    public partial class FormCode
    public void InternalStartup()
    ((ButtonEvent)EventManager.ControlEvents["btnCreateFolder"]).Clicked += new ClickedEventHandler(btnCreateFolder_Clicked);
    public void btnCreateFolder_Clicked(object sender, ClickedEventArgs e)
    SPSite mySite = new SPSite("Http://thekingsbury/");
    SPWeb myWeb = mySite.OpenWeb();
    //Code to retreive the new library.
    XPathNavigator xLibraryName = MainDataSource.CreateNavigator();
    String NewLibraryName = xLibraryName.SelectSingleNode("/my:myFields/my:LibraryName", NamespaceManager).Value;
    //Code to retreive the library description.
    XPathNavigator xLibraryDesc = MainDataSource.CreateNavigator();
    String NewLibDesc = xLibraryDesc.SelectSingleNode("/my:myFields/my:LibraryDescription", NamespaceManager).Value;
    //Code to retreive the new folder name.
    XPathNavigator xFolderName = MainDataSource.CreateNavigator();
    String NewFolderName = xFolderName.SelectSingleNode("/my:myFields/my:FolderName", NamespaceManager).Value;
    //Creating the new library.
    myWeb.Lists.Add(NewLibraryName, NewLibDesc, SPListTemplateType.DocumentLibrary);
    myWeb.Update();
    //Creating the new folder within the new library.
    SPDocumentLibrary newDocLibrary = (SPDocumentLibrary)myWeb.Lists[NewLibraryName];
    SPFolderCollection newFolders = myWeb.Folders;
    newFolders.Add("http://thekingsbury/" + NewLibraryName + "/" + NewFolderName + "/");
    newDocLibrary.Update();
    I think everyone can use this.
     When you are generating a folder always try to avoid reserved characters  : ; # $ % ^ a and suchlike.

Maybe you are looking for

  • Can we use free goods in MTO,thirdparty

    Hi, We cannot use free goods in MTO,thirdparty processing, do we have any sap documents supporting it,can u pls provide. Regards SR

  • Issue In Sales Invoice DTW with down payment

    Dear Friends, I am trying to add some Sales Invoice with advance payment by DTW. Entries of Sales order , Sales Advance Down Payment request & Payment against Advance Down payment request are already done. In Invoice master file for DTW I add down pa

  • Problem with imported movies from Sony Cyber Shot

    Hello all, I have an unusal problem. My mate has got a brand new sony cybershot camera which does movies. These movies import into iPhoto no problem with sound. However if I then use that clip in iMovie there is no sound, it does not matter how I try

  • RoboHelp HTML v7

    Hi, Could anyone explain the exact significance of selecting the options Check for deleted files/Republish All while generating a help file. The help to RoboHelp just mentions that Republish All should not be used while merging projects. Thank you an

  • Show Message Before Send?

    Hi All, I think this is my last question (At least I hope so)... I am using the Groupwise objects to generate an EMail from my application which works fine, however I would like to show the EMail to the user before it is sent. So I programmatically c