473,390 Members | 1,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

How to access shared folder if it asks username password

Can you please help me on this I can access one shared folder (folder is in another mahine) from my machine using java program. But From another server machine while accessing the same folder it asks username & password. How can I access it using program. Please reply as soon as possible.

Thanks
Dec 31 '07 #1
3 15494
chaarmann
785 Expert 512MB
Can you please help me on this I can access one shared folder (folder is in another mahine) from my machine using java program. But From another server machine while accessing the same folder it asks username & password. How can I access it using program. Please reply as soon as possible.

Thanks
Enable FTP-access to this folder. FTP is the best protocol for file access.
Then simply use "ftp://username:password@servername/filepath/filename" as URL in your function that opens the file.
Dec 31 '07 #2
Enable FTP-access to this folder. FTP is the best protocol for file access.
Then simply use "ftp://username:password@servername/filepath/filename" as URL in your function that opens the file.
I used this URL. But it is taking as ftp:\username:password@servername\filepath\filenam e. And giving filenot found exception. saying incorrect path of folder/filename. please reply.
Dec 31 '07 #3
chaarmann
785 Expert 512MB
I used this URL. But it is taking as ftp:\username:password@servername\filepath\filenam e. And giving filenot found exception. saying incorrect path of folder/filename. please reply.
If it is taken as that, then you have used the wrong constructor.
read the JDK API about class File, you will see these 2 posbilities:
1.) File(String pathname)
Creates a new File instance by converting the given pathname string into an abstract pathname.

2.) File(URI uri)
Creates a new File instance by converting the given file: URI into an abstract pathname.


you should use the second one, of course, as I wrote "URL" before, and URI is part of URL.

here is an explanation of the difference, quoted from the JDK 1.3 API:
For Microsoft Windows platforms, the prefix of a pathname that contains a drive specifier consists of the drive letter followed by ":" and possibly followed by "\" if the pathname is absolute. The prefix of a UNC pathname is "\\"; the hostname and the share name are the first two names in the name sequence. A relative pathname that does not specify a drive has no prefix.
Jan 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
4
by: kthiagar | last post by:
Hi I am trying to connect to a password protected access file from VB.NET. I have no problem in connecting to Access, if I remove the password. This is what I am doing: In the server explorer,...
0
by: Chrisg | last post by:
Hello, How can I connect to a shared folder/file located on a remote computer in a workgroup environment. I can't use impersonation and LogonUserA() API because that only obtains a local user...
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
1
by: ajuwono | last post by:
Hi, I expect a dialog to specify username and password in C# as a dialog asks you for a username and password when you go Start Run >'Pathname'. The main objective is to get the user...
7
by: Speech Lover | last post by:
I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows server 2003 The event log says "X:\temp\abc.txt path not found" and stuff. Note that I have...
3
by: Charlotte | last post by:
Hello, info: I'me a rookie with IIS I have on a WinXP Pro the IIS installed, so I can test some pages before uploading to the hostserver online on the hostserver is a possibility (with the...
2
by: Andrius B. | last post by:
Hi. I am writing an app, whitch has to access a database, located on another computer (Intranet). Let's say, the computer where the app is to be installed, is "Computer1". The computer with the...
25
by: p byers | last post by:
Good Morning Folks I have a LAN Among the several connections to it are the following four devices: A MAXSTOR network Storage Device A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4) A...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.