This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes is it a security related issue ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "is it a security related issue ??" Watch "is it a security related issue ??" New topic
Author

is it a security related issue ??

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90



and the result is :


run:
file status :true
file not found : D:\ (The system cannot find the path specified)
BUILD SUCCESSFUL (total time: 0 seconds)


please explain, thank you.
Soumyajit Hazra
Ranch Hand

Joined: Jun 26, 2007
Posts: 136
Your FileOutputStream receives a drive name not a file name. Try with


Java Programmer | SCJP 1.5 | SCWCD 1.4
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

ok ok,
in this case ??




run:
file status :false
file not found : H:\sample.txt (Access is denied)
BUILD SUCCESSFUL (total time: 0 seconds)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Why did you switch from D: to H:? Do you even have an H: drive? If so, is it writable, and not a CD-ROM?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90



actually in the previous post , i want to explain the reason.

H drive is not the cd rom and any read only type disc. it is a Hard disk.
this partition is in the second hard disc i have.
at first, i have tried to create files on H drive.
when it is throwing exception, i tried on D drive.
in those trails, i forget that i am using a drive (D:\\) and not a file (D:\\sample.txt) etc.

that is the whole story.

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

please consider this also :






run:
file status :false
IO Exception : Access is denied
BUILD SUCCESSFUL (total time: 1 second)




Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Can you create a file in that directory from Windows itself?
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

thank you,
by using your post, my problem is solved.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

So can I assume the problem was caused by Windows security?
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

yes,
file creation is not allowed at that place (on the partitions of , secondary hard disc) . . .
only folders are allowed . . . i don't know why this was happening . . . if possible, please explain the reason . . .
thanks once again,
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Ask your system administrator about file and folder rights.
 
 
subject: is it a security related issue ??
 
Similar Threads
How to generate WSDL file for any JAX-WS?
How to read properties file in netbeans?
JavaBeans
Delete() odes not always delete file!!!!
write into a file?