Solved

Remote machine file access : PART-II

Posted on 2004-08-26
15
179 Views
Last Modified: 2010-03-31
Hello Everybody,

Continuing from the following topic :
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21107473.html

When I pass argument in the form:

InputStream in = new URL("ftp://username:password@domain.com/file.ext").openStream();

I get exception as :

java.io.FileNotFoundException:/opt/home/testdir/test.txt :  A file or directory in the path name does not exist.

File permissions on test.txt are  -rw-r--r--

and I am connecting as authorized user not anonymous user.

Thanks,
Paluindian
0
Comment
Question by:paluindian
[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
  • 5
  • 3
  • 3
  • +2
15 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11908797
what is the root directory of your ftp server?

(you didn't need to open a new question)
0
 

Author Comment

by:paluindian
ID: 11908818
To clarify more, when I put this URL URL("ftp://username:password@domain.com/file.ext") in  Windows Explorer I get folder path created in Windows Explorer but I can not click on those folders and access files inside it. Sorry for the confusion for early part, I thought I could access it...I was just very happy to know FTP URL access to the file.

Through Windows Explorer I get message :

" Windows can not access this folder, make sure you have typed folder name correctly and that you have permission to access this folder"

Details:

530 user Anonymous unknown


Is this something to do with permissions? Machine is not set to access via FTP or something?

Thanks in advance,
Paluindian
0
 

Author Comment

by:paluindian
ID: 11908834
I did not understand ...root directory of FTP server?
Here is the ftp resides if this is what you meant

/usr/bin/ftp

paluindian
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:existenz2
ID: 11908879
It seems that the ftp server thinks you are logging in with Anonymous and while this is not allowed or that you are using an invalid username (This is in most FTP daemons handled as an Anonymous login). So it looks to be a permissions problem on the serverside or you didnt inserted the right username/password combination to login. So i think you should have a look at those settings.
0
 
LVL 92

Expert Comment

by:objects
ID: 11908918
can you post the ftp commands you would use to access the file
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11912888
Can you post the url you're *actually* using (obviously change the username and password parts)?
0
 

Author Comment

by:paluindian
ID: 11914804
I'm using following URL:

ftp://username:password@machinename/opt/home/testdir/test.txt

If I have understood correctly objects your question, you meant manually accessing file:
I use:

ftp machinename
username (prompted) : username
password (prompted) : password
cd /opt/home/testdir
get testdir.txt

Thanks,
Paluindian

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11914955
>>ftp machinename

Is that being done directly on the ftp host, i.e. on the same machine as 'machinename'?
0
 

Author Comment

by:paluindian
ID: 11915241
>>Is that being done directly on the ftp host, i.e. on the same machine as 'machinename'?

Yes, I can manually connect to the same machine as 'machinename'
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11915282
OK, can you try the same ftp commands as above from the windows client?
0
 

Author Comment

by:paluindian
ID: 11917648
Hey all...

I tried this borrowing my colleagues userid/password...it is working. I guess some problem with my account. I could access it with above commands from the windows client but not programmatically. But anyway...I do not have to use my login...because others are going to use this automation...if there userid works...it works for me ;-)

Thanks ya all,
Paluindian
0
 
LVL 92

Expert Comment

by:objects
ID: 11918262
good to hear :)
0
 
LVL 14

Expert Comment

by:existenz2
ID: 11918623
paluindian, that it locally works most likely means it has only local rights and not external, but nice to see you solved it :). My suggestion is always to try multi accounts if one account is not working, because it might be possible that it's an userright issue which is not a programming fault.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12280071
PAQed, with points refunded (125)

Computer101
E-E Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HashTable highest marks enumeration alternative 9 48
servlet example 11 59
Running JavaFX on the Raspberry Pi 27 139
American Express @Work site and Java 4 67
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

733 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