java - File Fetching from file directory rather than HTTP URL -


previously, code developed fetch file content http url "http://storage.googleapis.com/abc". but, requirement has got changed , demands instead of using http url link, should need use file directory location of server. (i.e., /var/puru/abc).

so, there proper or significant way , fulfill requirement without much-doing changes existing code drastically?

i have provided code sample here, provide file url(baseurl) using http url actually.

private url getfileurl(string filename) throws malformedurlexception {          try {             date dateobj = dateformatter.parse(date);             calendar cal = calendar.getinstance();             cal.settime(dateobj);             return new url(baseurl, cal.get(calendar.year) + "/" + filename);         } catch (parseexception e) {             e.printstacktrace();         }         return null;     } 

please suggest, , guide me.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -