org.restlet.resource.Directory.isModifiable()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中org.restlet.resource.Directory.isModifiable()方法的一些代码示例,展示了Directory.isModifiable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Directory.isModifiable()方法的具体详情如下:
包路径:org.restlet.resource.Directory
类名称:Directory
方法名:isModifiable

Directory.isModifiable介绍

[英]Indicates if modifications to local resources (most likely files) are allowed. Returns false by default.
[中]指示是否允许修改本地资源(很可能是文件)。默认情况下返回false。

代码示例

代码示例来源:origin: org.restlet.jee/org.restlet.ext.platform

public static void collectResource(CollectInfo collectInfo,
    Directory directory, String basePath, ChallengeScheme scheme,
    List<? extends IntrospectionHelper> introspectionHelper) {
  Resource resource = getResource(collectInfo, directory, basePath,
      scheme);
  // add operations
  ArrayList<Operation> operations = new ArrayList<>();
  operations.add(getOperationFromMethod(Method.GET));
  if (directory.isModifiable()) {
    operations.add(getOperationFromMethod(Method.DELETE));
    operations.add(getOperationFromMethod(Method.PUT));
  }
  resource.setOperations(operations);
  for (IntrospectionHelper helper : introspectionHelper) {
    helper.processResource(resource, directory.getClass());
  }
  addSectionsForResource(collectInfo, resource);
  collectInfo.addResource(resource);
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.apispark

public static void collectResource(CollectInfo collectInfo,
    Directory directory, String basePath, ChallengeScheme scheme,
    List<? extends IntrospectionHelper> introspectionHelper) {
  Resource resource = getResource(collectInfo, directory, basePath,
      scheme);
  // add operations
  ArrayList<Operation> operations = new ArrayList<>();
  operations.add(getOperationFromMethod(Method.GET));
  if (directory.isModifiable()) {
    operations.add(getOperationFromMethod(Method.DELETE));
    operations.add(getOperationFromMethod(Method.PUT));
  }
  resource.setOperations(operations);
  for (IntrospectionHelper helper : introspectionHelper) {
    helper.processResource(resource, directory.getClass());
  }
  addSectionsForResource(collectInfo, resource);
  collectInfo.addResource(resource);
}

代码示例来源:origin: org.restlet.jse/org.restlet.ext.platform

public static void collectResource(CollectInfo collectInfo,
    Directory directory, String basePath, ChallengeScheme scheme,
    List<? extends IntrospectionHelper> introspectionHelper) {
  Resource resource = getResource(collectInfo, directory, basePath,
      scheme);
  // add operations
  ArrayList<Operation> operations = new ArrayList<>();
  operations.add(getOperationFromMethod(Method.GET));
  if (directory.isModifiable()) {
    operations.add(getOperationFromMethod(Method.DELETE));
    operations.add(getOperationFromMethod(Method.PUT));
  }
  resource.setOperations(operations);
  for (IntrospectionHelper helper : introspectionHelper) {
    helper.processResource(resource, directory.getClass());
  }
  addSectionsForResource(collectInfo, resource);
  collectInfo.addResource(resource);
}

代码示例来源:origin: org.restlet.gae/org.restlet.ext.platform

public static void collectResource(CollectInfo collectInfo,
    Directory directory, String basePath, ChallengeScheme scheme,
    List<? extends IntrospectionHelper> introspectionHelper) {
  Resource resource = getResource(collectInfo, directory, basePath,
      scheme);
  // add operations
  ArrayList<Operation> operations = new ArrayList<>();
  operations.add(getOperationFromMethod(Method.GET));
  if (directory.isModifiable()) {
    operations.add(getOperationFromMethod(Method.DELETE));
    operations.add(getOperationFromMethod(Method.PUT));
  }
  resource.setOperations(operations);
  for (IntrospectionHelper helper : introspectionHelper) {
    helper.processResource(resource, directory.getClass());
  }
  addSectionsForResource(collectInfo, resource);
  collectInfo.addResource(resource);
}

代码示例来源:origin: org.restlet.osgi/org.restlet.ext.platform

public static void collectResource(CollectInfo collectInfo,
    Directory directory, String basePath, ChallengeScheme scheme,
    List<? extends IntrospectionHelper> introspectionHelper) {
  Resource resource = getResource(collectInfo, directory, basePath,
      scheme);
  // add operations
  ArrayList<Operation> operations = new ArrayList<>();
  operations.add(getOperationFromMethod(Method.GET));
  if (directory.isModifiable()) {
    operations.add(getOperationFromMethod(Method.DELETE));
    operations.add(getOperationFromMethod(Method.PUT));
  }
  resource.setOperations(operations);
  for (IntrospectionHelper helper : introspectionHelper) {
    helper.processResource(resource, directory.getClass());
  }
  addSectionsForResource(collectInfo, resource);
  collectInfo.addResource(resource);
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl

methodsList.add(Method.GET);
if (directory.isModifiable()) {
  methodsList.add(Method.DELETE);
  methodsList.add(Method.PUT);

代码示例来源:origin: org.restlet.osgi/org.restlet

@Override
public Representation put(Representation entity) throws ResourceException {
  if (!this.directory.isModifiable()) {
    setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED, "The directory is not modifiable.");
    return null;
  }
  // Transfer of PUT calls is only allowed if the readOnly flag is not set.
  Request contextRequest = new Request(Method.PUT, this.targetUri);
  // Add support of partial PUT calls.
  contextRequest.getRanges().addAll(getRanges());
  contextRequest.setEntity(entity);
  Response contextResponse = new Response(contextRequest);
  contextRequest.setResourceRef(this.targetUri);
  getClientDispatcher().handle(contextRequest, contextResponse);
  setStatus(contextResponse.getStatus());
  return null;
}

代码示例来源:origin: org.restlet.osgi/org.restlet

@Override
public Representation delete() throws ResourceException {
  if (!this.directory.isModifiable()) {
    setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED, "The directory is not modifiable.");
    return null;

相关文章