Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B65C39CEC for ; Thu, 5 Apr 2012 11:14:00 +0000 (UTC) Received: (qmail 17232 invoked by uid 500); 5 Apr 2012 11:13:59 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 17059 invoked by uid 500); 5 Apr 2012 11:13:58 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 16652 invoked by uid 99); 5 Apr 2012 11:13:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2012 11:13:57 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of GGregory@rocketsoftware.com designates 216.82.242.147 as permitted sender) Received: from [216.82.242.147] (HELO mail95.messagelabs.com) (216.82.242.147) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2012 11:13:50 +0000 X-Env-Sender: GGregory@rocketsoftware.com X-Msg-Ref: server-11.tower-95.messagelabs.com!1333624408!17025048!1 X-Originating-IP: [137.134.240.188] X-StarScan-Version: 6.5.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31792 invoked from network); 5 Apr 2012 11:13:28 -0000 Received: from unknown (HELO postal.rocketsoftware.com) (137.134.240.188) by server-11.tower-95.messagelabs.com with AES128-SHA encrypted SMTP; 5 Apr 2012 11:13:28 -0000 Received: from NWT-S-MBX1.rocketsoftware.com ([fe80::34fc:6d7f:6837:62b]) by nwt-s-cas1.rocketsoftware.com ([::1]) with mapi id 14.02.0283.003; Thu, 5 Apr 2012 07:12:51 -0400 From: Gary Gregory To: Commons Users List CC: "issues@commons.apache.org" Subject: Re: Commons VFS StaticUserAuthenticator Issue Thread-Topic: Commons VFS StaticUserAuthenticator Issue Thread-Index: AQHNExYZGLeRR7qDR0ahdT7KiUkX1paME+dO Date: Thu, 5 Apr 2012 11:12:50 +0000 Message-ID: References: <1333621386695-4534444.post@n4.nabble.com> In-Reply-To: <1333621386695-4534444.post@n4.nabble.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Have you tried http://commons.apache.org/vfs/filesystems.html#CIFS? Gary On Apr 5, 2012, at 6:23, "shabeena.k" wrote: > Hi All, >=20 > I am using the Commons VFS API for accessing resources from a remote mach= ine > over LAN. > However, it doesn't work for one of the cases,details of which are listed > below: >=20 > A directory containing files exists on the remote machine.However,this > directory is not shared.Other machine tries to access this folder with th= e > username and password used to connect to this machine.But this turns out = to > be a failure.The snippet of this is given below: >=20 > StaticUserAuthenticator mwwObjStaticUserAuth =3D new =20 > StaticUserAuthenticator(mwwStrLANUsername,mwwStrLANPassword, null); > FileSystemOptions mwwObjileSystemOptions =3D new FileSystemOptions();=20 >=20 > DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(mwwObji= leSystemOptions, > mwwObjStaticUserAuth); > =20 > FileSystemManager fsManager =3D VFS.getManager(); >=20 > String path =3D > "//"+mwwStrSourceMachine+File.separator+mwwStrFolderPath+File.separator+"= filename"; > FileObject folder =3D fsManager.resolveFile(path,mwwObjileSystemOptions); > FileContent cwwObjFileContent =3D folder.getContent(); > // more logic to download file on local machine =20 >=20 > But this leads to a FileNotFoundException, the entire trace is shown belo= w: >=20 >=20 > org.apache.commons.vfs2.FileNotFoundException: Could not read from > "file:////WS-005/E:/abc/xyz/site-1.6.12.zip" because it is a not a file. > at > org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(Abstra= ctFileObject.java:1315) > at > org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(Defaul= tFileContent.java:396) > at landownload.Snippet.download(Snippet.java:63) > at landownload.Snippet.main(Snippet.java:23) > Caused by: java.io.FileNotFoundException: > \\WS-005\E:\abc\xyz\site-1.6.12.zip (The network path was not found) > at java.io.FileInputStream.open(Native Method) > at java.io.FileInputStream.(FileInputStream.java:106) > at > org.apache.commons.vfs2.provider.local.LocalFile.doGetInputStream(LocalFi= le.java:209) > at > org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(Abstra= ctFileObject.java:1307) > ... 3 more >=20 > -- > View this message in context: http://apache-commons.680414.n4.nabble.com/= Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534444.html > Sent from the Commons - Issues mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org