Solved

Get file name into a directory

Posted on 2002-03-07
2
166 Views
Last Modified: 2010-03-31
hi experts,

      How to capture the file name into a specific directory? Do I need to use the package "JNDI"? Please help.
0
Comment
Question by:wilsontang
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
m_onkey_boy earned 100 total points
ID: 6849818
If I understand the question:

File f = new File("c:\\dir");
File[] aFiles = f.listFiles();
String[] aFilesByNames = f.list();
0
 
LVL 4

Expert Comment

by:m_onkey_boy
ID: 6849819
That was to view the files in a directory.  To create a new one:

File f = new File("c:\\dir\\myFile.tmp");

FileOutputStream fis = new FileOutputStream(f);

// write to file....
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bigHeights  challenge 13 55
triangle challenge 4 79
countHi2 challenge 7 44
@SBGen Method 3 25
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now