tags:

views:

86

answers:

5

Well, this question refers directly to windows 7.

I run the same code on windows xp and on windows 7.

In windows XP it's true, and in windows 7 it's false!!

if (file.exists() || file.getAbsoluteFile().exists())

Any ideas?

The URL is to another server where the file is located.

EDITED

The user has permission to view/create/delete/edit the directory. I tried from that windows 7 to access by Run option of windows the folder and create another one, and got no permission errors.

The URL is (+-):

\\\\myip\\C$\\Devel\\workspace\\project\\HibernateSearch\\indexes

EDITED 2

I changed the URL to be local on that machine, and now it finds the directory and everything is fine.

What should be the correct URL than for network IP?

+1  A: 

Is it possible that the win7 machine does not have access to the server where the file is located?
Did you try to access the file from commands line/windows explorer?

Itay
Yes I did. And with no problems!
Odelya
A: 

Hmm. Permission problem? Maybe the Win7 user identity can't actually see the file?

Jonners
I edited my question. It has permissions
Odelya
A: 

Which file are you looking for? If it is a system file / folder, maybe it exists in Windows XP and not in Windows 7.

gpeche
I edited my question with the URL
Odelya
+1  A: 

That is a very uncommon URL format. Maybe MS has fixed something in Win 7 ;-). Try file://myip/C|/Devel/workspace/project/HibernateSearch/indexes

Arne Burmeister
"Uncommon" must be a euphemism for "broken". The OP's "url" ain't a real URL according to any version of the URL specification.
Stephen C
When I write: file://myip/C|/Devel/workspace/project/HibernateSearch/indexes JAVA changes it to : file:\\myip\C|\Devel\workspace\project\HibernateSearch\indexes and doesn't find the file!
Odelya
This URL does not work for me (as I mentioned in previous comment that JAVA changes the slashes)
Odelya
A: 

The problem was with the C$

I changed the Devel directory to be shared in public, and the URL was changed to:

\\myip\Devel\workspace\project\HibernateSearch\indexes (no need to define the drive)

Odelya
Makes sense. You can only force a share with C$ if you're an admin. Under UAC your app doesn't have your admin powers unless you ran it elevated.
Kate Gregory