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

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

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

Directory.setListingAllowed介绍

[英]Indicates if the display of directory listings is allowed when no index file is found.
[中]指示在找不到索引文件时是否允许显示目录列表。

代码示例

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

@Override
  public Restlet createInboundRoot() {
    getConnectorService().getClientProtocols().add(Protocol.CLAP);
    getConnectorService().getServerProtocols().add(Protocol.HTTP);
    final Directory directory = new Directory(getContext(),
        "clap://class");
    directory.setListingAllowed(true);
    directory.setDeeplyAccessible(true);
    return directory;
  }
};

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

@Override
  public Restlet createInboundRoot() {
    Router router = new Router(getContext());

    // Serve static files (images, etc.)
    String rootUri = "file:///" + System.getProperty("user.home");
    Directory directory = new Directory(getContext(), rootUri);
    directory.setListingAllowed(true);
    router.attach("/home", directory);

    // Attach the hello web service
    router.attach("/hello", HelloServerResource.class);

    return router;
  }
}

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

@Override
public Restlet createInboundRoot() {
  // Create a simple password verifier
  MapVerifier verifier = new MapVerifier();
  verifier.getLocalSecrets().put("scott", "tiger".toCharArray());
  DigestAuthenticator guard = new DigestAuthenticator(getContext(),
      "TestRealm", "mySecretServerKey");
  MapVerifier mapVerifier = new MapVerifier();
  mapVerifier.getLocalSecrets().put("scott", "tiger".toCharArray());
  guard.setWrappedVerifier(mapVerifier);
  // Create a Directory able to return a deep hierarchy of files
  Directory directory = new Directory(getContext(), "file:///tmp");
  directory.setListingAllowed(true);
  guard.setNext(directory);
  return guard;
}

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

@Override
public Restlet createInboundRoot() {
  // Create a simple password verifier
  MapVerifier verifier = new MapVerifier();
  verifier.getLocalSecrets().put("scott", "tiger".toCharArray());
  // Create a Guard
  ChallengeAuthenticator authenticator = new ChallengeAuthenticator(
      getContext(), ChallengeScheme.HTTP_BASIC, "Tutorial");
  authenticator.setVerifier(verifier);
  // Create a Directory able to return a deep hierarchy of files
  Directory directory = new Directory(getContext(), ROOT_URI);
  directory.setListingAllowed(true);
  authenticator.setNext(directory);
  return authenticator;
}

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

@Override
public Restlet createInboundRoot() {
  // Create a simple password verifier
  MapVerifier verifier = new MapVerifier();
  verifier.getLocalSecrets().put("scott", "tiger".toCharArray());
  // Create a guard
  ChallengeAuthenticator guard = new ChallengeAuthenticator(getContext(),
      ChallengeScheme.HTTP_BASIC, "Tutorial");
  guard.setVerifier(verifier);
  // Create a Directory able to return a deep hierarchy of files
  Directory directory = new Directory(getContext(), "file:///tmp");
  directory.setListingAllowed(true);
  guard.setNext(directory);
  return guard;
}

代码示例来源:origin: org.umlg/runtime-restlet

slickgrid.setListingAllowed(true);
router.attach("/javascript/", slickgrid);
css.setListingAllowed(true);
router.attach("/css/", css);

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

directory.setListingAllowed(true);
router.attach("/static", directory);

相关文章