473,379 Members | 1,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Creating a new folder using java

Hi freinds,
Is it possible to create a new folder in a given directory using java..?
I need to create the directory and then copy some images into the same..

Thanks
Nov 14 '07 #1
5 24065
JosAH
11,448 Expert 8TB
Hi freinds,
Is it possible to create a new folder in a given directory using java..?
I need to create the directory and then copy some images into the same..

Thanks
Have a look at the FileSystemView class; it can create directories given
an abstract path (a File object).

kind regards,

Jos
Nov 14 '07 #2
Thanks for the concern..
But I need the exact implementation of the abstract function createNewFolder..
Please help..
Nov 14 '07 #3
JosAH
11,448 Expert 8TB
Thanks for the concern..
But I need the exact implementation of the abstract function createNewFolder..
Please help..
The FileSystemView has a static factory method that gives you an implementation
of the abstract FileSystemView class. Check the API documentation again.

kind regards,

Jos
Nov 14 '07 #4
Hi freinds,
Is it possible to create a new folder in a given directory using java..?
I need to create the directory and then copy some images into the same..

Thanks
you can use filename.mkdir(); for creating new directory.
Nov 15 '07 #5
Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2. public class FolderCreate {
  3.  
  4.     public static void main(String args[]){
  5.     File f = new File("C:\\TEST");
  6.     try{
  7.         if(f.exists()==false){
  8.             f.mkdir();
  9.         System.out.println("Directory Created");
  10.         }
  11.         else{
  12.         System.out.println("Directory is not created");
  13.         }
  14.     }catch(Exception e){
  15.         e.printStackTrace();
  16.        }
  17.     }
  18. }
Oct 28 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Udipta | last post by:
I am making a java application where I am required to record voice in a-law format. The program i have written starts perfectly without giving any error or warning, but as soon as i start recording...
8
by: dbaplusplus | last post by:
I worked on web development using java script many many years, so I am now a newbie to javascript. I have a single html page, which is generated dynamically using some programming language. Web...
1
by: geniusamita | last post by:
I am second year student of computer engineering. I am working on task which works similar to javadoc for c++ programs.I want to create a folder having the same name that of input c++ program,in...
3
by: SelvaSA | last post by:
Dear All, I am doing my project is to print the files whatever the users are putting into the folder, which i have created and mapped. I have query how to watch a folder with the time period...
1
by: thashi | last post by:
I want to load image using jfilechooser and save it in folder i also want to view it in that panel after saving
3
hidash
by: hidash | last post by:
hi all, i have a project to open some applications using java. i am creating web page using jsp from the web page i have to open a file example word file with the msword application by clicking a...
5
by: meenu_susi | last post by:
hi all Could you please help me out i creating folder using vbscript.. I have used the following code... <SCRIPT LANGUAGE="VBScript"> <!-- Option Explicit
1
by: meenu_susi | last post by:
hello could u please send me the code for creating a folder in ftp server using vb script I have tried with the following code <script language="vbscript"> Set objFSO =...
5
by: sanchit007 | last post by:
Is this the right code to hide a folder using java? public class kalu { public static void main(String args) { try { Runtime rt =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.