My java web application is deployed on server machine. I have a share drive which is accessible from client machine as well as server machine . Using below code i am able to open that drive on server machine :
Spring Controller code :
@RequestMapping(value = "/openAttachment", method = RequestMethod.POST)
public ResponseEntity<List<String>>
OpenFolder(@RequestParam("workflowName") String workflowName ) throws
IOException, InterruptedException {
String folderPath =Constants.workFlowAttachPath+workflowName;
if ((new File(folderPath)).exists()) {
Process p = Runtime
.getRuntime()
.exec("rundll32 url.dll,FileProtocolHandler "+folderPath);
p.waitFor();
}
List<String> msgList = new ArrayList<> ();
msgList.add(Constants.SUCCESSFUL);
return new ResponseEntity<List<String>>(msgList, HttpStatus.OK);
}
Constant used here is :
public static final String workFlowAttachPath="\\\\10.82.31.27\\Area20\\Attachment\\";
But i am unable to open this folder from local machine(browser) on local machine . Is this possible ? If possible then how ? Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire