本文整理汇总了Java中com.aspose.storage.model.FileExistResponse类的典型用法代码示例。如果您正苦于以下问题:Java FileExistResponse类的具体用法?Java FileExistResponse怎么用?Java FileExistResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileExistResponse类属于com.aspose.storage.model包,在下文中一共展示了FileExistResponse类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GetIsExist
import com.aspose.storage.model.FileExistResponse; //导入依赖的package包/类
@Test
public void GetIsExist() throws ApiException {
FileExistResponse response = null;
try {
response = storageApi.GetIsExist("AndroidTestFolder/SampleWordDocument.docx", "", "");
assertEquals("200", response.getCode());
} catch (ApiException ex) {
ex.printStackTrace();
}
}
示例2: GetIsExist
import com.aspose.storage.model.FileExistResponse; //导入依赖的package包/类
/**
* GetIsExist
* Check if a specific file or folder exists. Parameters: path - file or folder path e.g. /file.ext or /Folder1, versionID - file's version, storage - user's storage name.
* @param Path String
* @param versionId String
* @param storage String
* @return FileExistResponse
*/
public FileExistResponse GetIsExist (String Path, String versionId, String storage) {
Object postBody = null;
// verify required params are set
if(Path == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String resourcePath = "/storage/exist/{Path}/?appSid={appSid}&versionId={versionId}&storage={storage}";
resourcePath = resourcePath.replaceAll("\\*", "").replace("&", "&").replace("/?", "?").replace("toFormat={toFormat}", "format={format}");
// query params
Map<String, String> queryParams = new HashMap<String, String>();
Map<String, String> headerParams = new HashMap<String, String>();
Map<String, String> formParams = new HashMap<String, String>();
if(Path!=null)
resourcePath = resourcePath.replace("{" + "Path" + "}" , apiInvoker.toPathValue(Path));
else
resourcePath = resourcePath.replaceAll("[&?]Path.*?(?=&|\\?|$)", "");
if(versionId!=null)
resourcePath = resourcePath.replace("{" + "versionId" + "}" , apiInvoker.toPathValue(versionId));
else
resourcePath = resourcePath.replaceAll("[&?]versionId.*?(?=&|\\?|$)", "");
if(storage!=null)
resourcePath = resourcePath.replace("{" + "storage" + "}" , apiInvoker.toPathValue(storage));
else
resourcePath = resourcePath.replaceAll("[&?]storage.*?(?=&|\\?|$)", "");
String[] contentTypes = {
"application/json"};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
try {
response = apiInvoker.invokeAPI(basePath, resourcePath, "GET", queryParams, postBody, headerParams, formParams, contentType);
return (FileExistResponse) ApiInvoker.deserialize(response, "", FileExistResponse.class);
} catch (ApiException ex) {
if(ex.getCode() == 404) {
throw new ApiException(404, "");
}
else {
throw ex;
}
}
}