Solved

Get file name into a directory

Posted on 2002-03-07
2
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
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 …

695 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