How to create a Folder using java.

Hi All,
I have a doubt. I want to create a folder using java.
Inputs are the destination where the folder should be created and the name of the folder. Plz help me in this regard.
thanks and regards,
Vincent .R.

check out javadoc for java.io
File reldir=new File("NewDir");//relatively where your program runs
reldir.mkdir();
File absdir=new File("C:/NewDir");//absolute path
reldir.mkdir();
File newdir=new File(absdir,"SubDir");//defines another dir under absdir
newdir.mkdir();
Gil

Similar Messages

  • How to run .jar on linux & how to create .jar file using java?

    hi, may i know how to run .jar on linux & how to create .jar file using java? Can u provide the steps on doing it.
    thanks in advance.

    Look at the manual page for jar:
    # man jar
    Also you can run them by doing:
    # java -jar Prog.jar

  • How to create sub domain using java ?

    how to create sub domain using java ?
    for example:
    name1.domainname.com
    name2.domainname.com
    is it possibe ?

    You don't do that using Java.
    Consult the documentation of the application server in question how to configure it. If you're using for example Tomcat 6.0, then you should be consulting this document: [http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html].

  • How to create a TOOLBOX using Java  - a real CHALLENGE for U

    Hello,
    I want to create a Toolbox using Java which will contain different components of my interest.I should be able to select one component and paste it in a frame also be able set the property of individual component after placing in the frame,just like VB toolbox.
    Can anybody suggest with code samples??
    Regards,
    Suraj.

    You are essentially asking how to write an IDE (Integrated Development Environment). This is a big question. You might start by looking at existing IDE's (JBuilder, Forte...) and see how they do it. If you want source, there is probably an open source IDE you can lift most of your code from.

  • How to create sql database using java frame or appelet?

    hi ! i am working on database project i want to create a database using java frame or applet where it asks user to select the location for database to be created , after user have specified the path then the programs creates the database, again i want that database to be read and write by another frame or applet but as user select the path how do i make the connectivity. i just have basic knowledge on java. please give me idea how can i process further.
    thanks a lot

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • How to create a folder using plsql

    hi all
    i want create a folder using plsql procedures .

    I am not sure weather you can create a folder on database server file system using pl/sql code but you certainly can create/read/write file system files using UTL_FILE package.
    'The Oracle supplied package UTL_FILE can be used to read and write files that are located on the server. It cannot be used to access files locally, that is on the computer where the client is running.'

  • How to create a class using java script..

    Hi all,
    Iam new to java script and I tried out the following program but its not working..I basically created a class just like a java prog' but Iam not getting any output or error.Iam attaching the code below.
    If I created one function inside the script and create one object its working fine but what should I do when I have a lot of function??so I created a class and put all the function and created an object but its not working..
    Do let me know what changes should I do..Iam attaching the code which I had written. or give me an example of how to create a class with couple of functions using JAVASCRIPT
    Thanks
    Avis_su
    <html>
    <head><title>JSP Page</title></head>
    <body>
    <SCRIPT language = "JavaScript">
    <!--
    //Created classes
    class book
    var title: String;
    var author:String;
    function author()
    doucument.write("Author is " +this.author);
    function tile()
    doucument.write("Title is " +this.title);
    function printall()
    var counter = 0;
    function author();
    function title();
    var chapters = Array[String];
    for(chapter in this chapters)
    counter++;
    document.write("Chapter" counter" :"+this.chapters[chapter]+"<br>");
    var thisbook = new book()
    thisbook.author = "Sivagami";
    thisbook.title = "MS in CS giude";
    thisbook.chapters = new Array[10];
    thisbook[0] = "Prepare to Excell in all ";
    thisbook[1] = "Learn to be happy";
    thisbook[2] = "Learn to be healthy mentally emotionally physically";
    thisbook[3] = "Siva and Subbu along with kidssssss will be successful in future";
    thisbook.printall();
    //-->
    </script>
    </body>
    </html>

    Run this program to get your answer:
    public class AnswerToYourPost {
    public static void main(String args[]) {
    System.out.println("TRUE/FALSE: This question
    ion belongs on a Java forum.\n"
    + "ANSWER: " + ("Javascript" == "Java"));
    }Since when do we compare objects for equality using operator == ?

  • How to create a database using Java?

    Hi there..
    I'm a student who is currently studying IT and was asked to do a project based on database but create using Java.. since i'm a beginner..i was wondering whether is it possible to do that?
    and if it is possible.. can you kindly show me a sample of code on how to start the project...
    thank you
    yours sincerely,
    Shafini

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • How to create a folder through java

    Hi All,
    Can any one give the solution of my prob.
    I want to create a folder in windows m/c through java programe .Is it possible.
    If yes then kindly suggest me how...?
    Thanks In advance
    Vikas

    String newFolderPath = "C:\\";
    String newFolderName = "MyFolder";
    String spoonFeeding = newFolderPath + newFolderName;
    File f = new File(spoonFeeding);
    f.mkDir();

  • How to create a Folder using a SQL Query?

    Hi
    How can I create a Folder (eg. C:\MyNewFolder) using SQL Query?

    Hi,
    I added some code in order to get the result from the xp_cmdshell command
    This returns null if successfull, if an error occurs returns the error message. May be useful instead of getting an sql error
    Code Snippet
    declare @cmdpath nvarchar(60), @Location nvarchar(100), @message nvarchar(max)
    set @Location = N'C:\Temp\Temp5'
    set @cmdpath = 'MD '+ @Location
    Create table #result
    result nvarchar(255)
    insert into #result (result) exec master.dbo.xp_cmdshell @cmdpath
    select @message = ISNULL(@message + ' - ','') + result from #result where result is not null
    select @message
    drop table #result
    Eralper
    http://www.kodyaz.com

  • How to create a LAN using java

    i want to create a LAN like environment using java [ maximum 4 clients] - how do i do this using socket programming .

    Create 4 independent network clients and this will work like four clients on different machines.

  • How to create the chart using java

    Hi Friends,
    I have one urgent requirement.I need to create the chart by using the table value.The value is stored in database like as follow..
    Attribute     IG
    Home     0.05
    Married     0.72
    Gender     0.05
    Employed     0.05
    Rate      0.05
    I need to get the highest value and create the parent node and lowest value is child node llike that i need create ...
    plz any body help me....

    You don't do that using Java.
    Consult the documentation of the application server in question how to configure it. If you're using for example Tomcat 6.0, then you should be consulting this document: [http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html].

  • How to create tagged PDF using java iText

    Hi
    I want to create PDF for accessibility purpose using java and iText
    Please help.
    Thanks in advance

    i did this some yrs ago ..scratched and found some code for you. Have a look
    package com.oq.utility;
    import com.lowagie.text.Cell;
    import com.lowagie.text.Document;
    import com.lowagie.text.Element;
    import com.lowagie.text.Font;
    import com.lowagie.text.HeaderFooter;
    import com.lowagie.text.Image;
    import com.lowagie.text.PageSize;
    import com.lowagie.text.Phrase;
    import com.lowagie.text.Rectangle;
    import com.lowagie.text.Table;
    import com.lowagie.text.pdf.BaseFont;
    import com.lowagie.text.pdf.PdfWriter;
    import com.oq.model.Sale;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.List;
    public class iTextExample
        public static void main (String[] args)
            iTextExample eg = new iTextExample();
            Sale sale = new Sale();
            sale.setOdrNumber("1");
            sale.setOdrDate("12-12-12");
            sale.setOdrCatCode("Örder");
            sale.setTotalInvValue("1234");
            sale.setRefNumber("in the line of fire");
            Sale sale1 = new Sale();
            sale1.setOdrNumber("1");
            sale1.setOdrDate("12-12-12");
            sale1.setOdrCatCode("Örder");
            sale1.setTotalInvValue("1234");
            sale1.setRefNumber("fire line");
            Sale sale2 = new Sale();
            sale2.setOdrNumber("1");
            sale2.setOdrDate("12-12-12");
            sale2.setOdrCatCode("Örder");
            sale2.setTotalInvValue("1234");
            sale2.setRefNumber("in the line of firel");
            List<Sale> list = new ArrayList<Sale>();
            list.add(sale);
            list.add(sale1);
            list.add(sale2);
            eg.printPDF(list);
        public void printPDF(List list) {
            Document document = new Document(PageSize.A4, 50, 50, 50, 50);
            try
                // creation of the different writers
                PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("iTextExample.pdf"));
                // various fonts
                BaseFont bf_helv = BaseFont.createFont(BaseFont.HELVETICA, "Cp1252", false);
                BaseFont bf_times = BaseFont.createFont(BaseFont.TIMES_ROMAN, "Cp1252", false);
                BaseFont bf_courier = BaseFont.createFont(BaseFont.COURIER, "Cp1252", false);
                BaseFont bf_symbol = BaseFont.createFont(BaseFont.TIMES_ROMAN, "Cp1252", false);
                // headers and footers must be added before the document is opened
                HeaderFooter footer = new HeaderFooter(
                            new Phrase("This is page: ", new Font(bf_courier)), true);
                footer.setBorder(Rectangle.NO_BORDER);
                footer.setAlignment(Element.ALIGN_CENTER);
                document.setFooter(footer);
                HeaderFooter header = new HeaderFooter(
                            new Phrase("This is a header without a page number", new Font(bf_symbol)), false);
                header.setAlignment(Element.ALIGN_CENTER);
                document.setHeader(header);
                document.open();
                Image img = Image.getInstance("arrow-ff.gif");
                img.setAlignment(Image.RIGHT | Image.TEXTWRAP);
                Table goodTable = new Table(2);     
                      Cell cell1 = new Cell(img);
                goodTable.addCell(cell1);
                document.add(goodTable);
                Cell c = new Cell("Header");
                c.setHeader(true);
                goodTable.addCell(c);
                Cell c1 = new Cell("Header1");
                c1.setHeader(true);
                goodTable.addCell(c1);
                Cell c2 = new Cell("Header2");
                c2.setHeader(true);
                goodTable.addCell(c2);
                goodTable.endHeaders();
                int j=0;
                          while (j< list.size())
                              Sale sale = (Sale)list.get(j);
                              c = new Cell(sale.getOdrDate());
                              goodTable.addCell(c);
                              goodTable.addCell(sale.getRefNumber());
                             j++;
                document.add(goodTable);
                // add text at an absolute position
                document.close();
            } catch (Exception ex) {
                System.err.println(ex.getMessage());
        }

  • How to create poll functionality using java(struts)

    Hiii,
    How to create the poll functionality to place into the site. I am using struts and XML file to store the data. We should able to view the result of the poll in horizontal bar graph.
    Please give me an idea how to implement it or provide a link which has the implementation.
    Thanks

    Whatever happened to good, old-fashioned thinking? All we see here now is "how to write <common application> with minimal input from myself?"-type questions. It's only a matter of time until we get people coming here asking "how to write <massively-scoped enterprise app>? What class I need for that?". Oh, wait. We already do get that

  • How to create mysql backup using java

    please i am trying to create a backup of my database using mysqldump with the runtime class. But it is not working out. Please can anyone give me a code that creates mysql backup in java?. I will be grateful.

    It might help to know what
    ushahemba wrote:
    it is not working outmeans.
    Please can anyone give me a code that creates mysql backup in java?.Now, I'm sorry, but why should anyone do your work for you?
    Read this thoroughly and conpletely, and implement the recommendations there.

Maybe you are looking for

  • Upgrade using another phone on my family plan

    I have a family plan. One of my regular non data phones is eligible for an upgrade, but my Iphone 3G is not. Can I go to ATT and sign a new 2 year contact on the non data phone and upgrade my 3G to a 3GS? I don't want a data plan on the other phone,

  • Error message when Burning CDs in Media Player

    When I burn cds in media player, i get error on about half of the songs in the playlist. I delete the errored songs, re-import them and then try to burn. same problem. then the cd tray locks up and i ether use the paper clip trick to open the tray or

  • Report to view the per unit of Production Order Actual cost

    Dear All, As we see the per unit cost of FG materail,when we estimate the cost by CK11N for FG materail, Is there any standard report available to view the per unit ACTUAL cost  of FG Materrial (Primary & Secondary Cost Element wise ) either from CO

  • Unable to create the Directory Server entry on the LDAP Console

    When I try to create the connection with the Directory Server I get the following message: Could not contact the DSCC agent on <server>. Use the command cacaoadm to check that the DSCC agent is installed and running on port 11162. I found a bug relat

  • Cover Flow Doesn't show some covers

    When iTunes imports a CD on a popular album, I click on Download Cover Art, and 75% of the time it can't find a cover art. I usually can find the cover art easily on www.allmusic.com and transfer it into iTunes. When I sync the Nano, I've noticed tha