kinlane
4/14/2012 - 6:53 PM

IDrive - EVS - REST API - deleteFile

IDrive - EVS - REST API - deleteFile

//For single file delete

String params = "uid=" + user + "&pwd=" + pass + "&pvtkey=" + key + "&p="+ strPath;

//For multiple file delete

String params = "uid=" + user + "&pwd=" + pass + "&pvtkey=" + key + "&p="+ strPath + "&p="+strPath + "&p="+strPath;

URL evsURL = new URL("https://<server address>/evs/deleteFile");

HttpURLConnection con = (HttpURLConnection) evsURL.openConnection();

con.setRequestMethod("POST");

con.setRequestProperty("Content-Type","application/x-www-form-urlencoded;  charset=UTF-8");

con.setDoOutput(true);


con.setDoInput(true);

con.setUseCaches(false);

DataOutputStream dout = new DataOutputStream(con.getOutputStream()); 

dout.writeBytes(params);

dout.flush();

dout.close();

BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));

while ((str = in.readLine()) != null)

{

result += str;

}