Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Other user has access denied error with BufferedWriter

 
Conrad Liu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys! I'm a fresh recruit, and I have an error that I can't quite seem to figure out.

I just started working on a giant code base, with collaboration with other programmers. It's been daunting but rewarding. Recently, I wrote some code that I pushed to github, only to find that for another user, it gives an FileNotFoundException: access denied. The relevant code is here:



At line 13 is where he gets the following error:
FileNotFoundException: temp.txt (Access denied)

I believe he's running Windows, though I'm not sure which version (I'm using a Mac); does anyone have any suggestions/leads as to what might be going on? Any feedback is appreciated!

EDIT: I just realized that I put this in Servlet...I'm not sure why...apologies! Is there a way to transfer this post to the right topic?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

You have not provided enough info to answer the question.

On line 5, you create a file path with values that we have no clue about; specially result.getArcPath(). Obviously, if the file isn't being found, the file path is incorrect.
 
Conrad Liu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Apologies for that.

result.getArcPath() returns a string corresponding to the filepath of the file I'm reading. This filepath is located within the project directory. It is set using:



On my system, this string is "/Users/conradliu/Github/puppeteer2/puppeteer/finch-ui/target/synbiotools.puppeteer-v0.1/WEB-INF/Results/Result_1467832373277/file_1467832373277_50185315_arcs.txt"

This filepath is the same directory I am attempting to write temp.txt to by modifying the string accordingly and setting it as a new variable tempFilePath.

This program works fine on my system, since the filepath is supposed to be retrieved by a given system's base path, as opposed to a path specific to my device.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do guarantee that the folder has write permissions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic