Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-04-2008, 05:43 AM
Member
 
Join Date: Sep 2008
Posts: 9
Rep Power: 0
mm2236 is on a distinguished road
Default cd.. in java
Hi
i want to save the user some typing, allow the user to type “..” to mean that the change directory should go up one level to the parent directory.
for example c:\1\2\3
if i write ..
output : c:\1\2

but my output is c:\

Code:
private void detailFile(DataInputStream in, ObjectOutputStream oOut) {
        try {
            String fileName = in.readUTF();

            File tmp = new File(file, fileName);

            if (tmp.isFile()) {
                oOut.writeObject(tmp);
            } else {
                oOut.writeObject(null);
            }

            fileName = null;
            tmp = null;
        } catch (Exception e) {
            try {
                oOut.writeObject(null);
            } catch (Exception e2) {
            }
        }
    }
plz help me
thanks
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-04-2008, 05:48 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
What's the combination of the code you post and the question?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +2. The time now is 04:43 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org