I have to read an online file utilizing a java application, however the file is within apache server on linux. I attempted with "" but does not work like home windows. How do i do this?
You will need to make use of the URL class: http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html
This is actually the standard method of reading through files from the URL.
Try being able to access your file via internet browser using url formatted like:
If you notice your file in browser, use that url out of your Java application, too.
This is dependent on numerous things. But we do not fully realize what question you are asking. Are you currently asking how you can retrieve a document over HTTP? How you can perform a file copy from Linux? Network shares?
When the file is offered through the webserver (within the docroot), the simplest strategy is most likely to request it over HTTP while using
URL class as mentioned above.
When the file isn't underneath the webroot (i.e. can not be specified as
http://webserver.name/some/path/to/file) then you will want to make use of another method. I am presuming this is exactly what you meant - you mention
\\, the Home windows file-discussing (SMB) protocol prefix. The simplest way is by using SSH and
sftp, that is most likely already placed on the Linux machine - you may want to enable it, and you will need a login. Then it is as easy as
scp user@host:/remote/file/path local/path. You are able to setup SSH secrets to prevent your password.