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
Post a Comment