🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2192

Re: File question

#2192
From: Owen Green
Date: Tue, 15 May 2001 14:36
16 lines
1287 bytes

> Why is it that when I , for example:
>
>    File Selectedfile = Filechooser.getSelectedFile();
>    String fDir  = Selectedfile.getPath();
>
> fDir, includes the file name as well. All I want it the path.

Because as far as the File class is concerned, a directory and a file are
equivalent. To get the directory where you've got a file do
  String fDir  =SelectedFile.getParent().getAbsaloutePath()
or somesuch...

hth
Owen
Technical Details
Message-ID: <3b013f0f_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3af7a44b$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,234664013f4e920b
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-05-15 07:41:03 PST
From: "Owen Green" <owen@norobots.unique.com>
Newsgroups: borland.public.jbuilder.java.api
References: <3af7a44b$1_1@dnews>
Subject: Re: File question
Date: Tue, 15 May 2001 15:36:59 +0100
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 213.86.7.136
Message-ID: <3b013f0f_1@dnews>
X-Trace: dnews 989937423 213.86.7.136 (15 May 2001 07:37:03 -0700)
Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews