Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Netbeans preventing Java from accessing network drive  RSS feed

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the Java code I'm using to test:


The results:





Netbeans >> About:



Windows 10 Pro (This issue never occurred in my machines running Windows 7)
 
Saloon Keeper
Posts: 2351
293
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would guess that Z:\Job Logging\addToDb is not a valid directory.

Refer to the doc for File#listFiles():
   Returns: An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.

 
Sheriff
Posts: 24088
54
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would guess that the Windows 7 machine was set up to automatically map the Z drive a long time ago, and the new Windows 10 machine hasn't had that done yet.
 
Sheriff
Posts: 5687
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then why does the program work when it's executed from the command line?
 
Michael Giara
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IntelliJ does not exhibit the problem.


Modifying the code to utilize jCIFS.  All seems to be going smooth so far.

 
Ron McLeod
Saloon Keeper
Posts: 2351
293
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Michael Giara wrote:IntelliJ does not exhibit the problem


Well .. different code and a different file path -- doesn't seems like a fair comparison.
 
Michael Giara
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Michael Giara wrote:IntelliJ does not exhibit the problem


Well .. different code and a different file path -- doesn't seems like a fair comparison.



Hahaha.  I knew I'd get called out for that.

 
Michael Giara
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fair point though.
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!