?
Solved

Get file name into a directory

Posted on 2002-03-07
2
Medium Priority
?
211 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 300 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

777 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