當前位置: 首頁>>代碼示例>>Java>>正文


Java ClassPath類代碼示例

本文整理匯總了Java中org.kurento.commons.ClassPath的典型用法代碼示例。如果您正苦於以下問題:Java ClassPath類的具體用法?Java ClassPath怎麽用?Java ClassPath使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ClassPath類屬於org.kurento.commons包,在下文中一共展示了ClassPath類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: copyClassesToRemote

import org.kurento.commons.ClassPath; //導入依賴的package包/類
private void copyClassesToRemote(final Class<?>[] classesName) throws IOException {
  String targetFolder = remoteKms.getTmpFolder();

  for (Class<?> className : classesName) {

    String classFile = "/" + className.getName().replace(".", "/") + ".class";

    Path sourceClass = ClassPath.get(classFile);

    Path classFileInDisk = Files.createTempFile("", ".class");
    Files.copy(sourceClass, classFileInDisk, StandardCopyOption.REPLACE_EXISTING);
    remoteKms.mkdirs(Paths.get(targetFolder + classFile).getParent().toString());
    remoteKms.scp(classFileInDisk.toString(), targetFolder + classFile);

    Files.delete(classFileInDisk);
  }
}
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:18,代碼來源:SystemMonitorManager.java

示例2: testInvalidFile

import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testInvalidFile() throws IOException {
  String expectedKmsUri = KmsUrlLoader.DEFAULT_KMS_URL;

  String kmsUri = new KmsUrlLoader(ClassPath.get("/invalid.properties")).getKmsUrl("id");

  assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:9,代碼來源:KmsUrlServiceLoaderTest.java

示例3: from

import org.kurento.commons.ClassPath; //導入依賴的package包/類
public static Collection<Object[]> from(String defaultBrowserConfigFile) {

    try {

      // Load executions from config file or system properties
      String executionsData =
          getProperty(getProperty(TEST_CONFIG_EXECUTIONS_PROPERTY, TEST_CONFIG_EXECUTIONS_DEFAULT));

      BrowserConfig browserConfig = null;
      Gson gson = new Gson();
      if (executionsData != null) {
        browserConfig =
            gson.fromJson("{\"executions\":" + executionsData + "}", BrowserConfig.class);

      } else {

        // If there is no browserConfig in config file, load default
        // from defaultBrowserConfigFile
        try (BufferedReader br = Files.newBufferedReader(
            ClassPath.get("/" + defaultBrowserConfigFile), StandardCharsets.UTF_8)) {
          browserConfig = gson.fromJson(br, BrowserConfig.class);
        }
      }

      return browserConfig.getTestScenario();

    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:31,代碼來源:TestScenario.java

示例4: testKmsUri

import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testKmsUri() throws IOException {

  String expectedKmsUri = "ws://test.url";

  String kmsUri = new KmsUrlLoader(ClassPath.get("/config-test.properties")).getKmsUrl("id");

  assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:10,代碼來源:KmsUrlServiceLoaderTest.java

示例5: testDefaultKmsUri

import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testDefaultKmsUri() throws IOException {

  String expectedKmsUri = KmsUrlLoader.DEFAULT_KMS_URL;

  String kmsUri = new KmsUrlLoader(ClassPath.get("/non-existing.properties")).getKmsUrl("id");

  assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:10,代碼來源:KmsUrlServiceLoaderTest.java

示例6: testKmsUriProviderWithLoad

import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testKmsUriProviderWithLoad() throws IOException {

  String expectedKmsUri = "ws://vnfmUri?load=50";

  KmsUrlLoader kmsUriLoader = new KmsUrlLoader(ClassPath.get("/provider-config.properties"));

  String kmsUri = kmsUriLoader.getKmsUrlLoad("id", 50);

  assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:12,代碼來源:KmsUrlServiceLoaderTest.java

示例7: testKmsUriProvider

import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testKmsUriProvider() throws IOException {

  String expectedKmsUri = "ws://vnfmUri";

  KmsUrlLoader kmsUriLoader = new KmsUrlLoader(ClassPath.get("/provider-config.properties"));

  String kmsUri = kmsUriLoader.getKmsUrl("id");

  assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
 
開發者ID:Kurento,項目名稱:kurento-java,代碼行數:12,代碼來源:KmsUrlServiceLoaderTest.java


注:本文中的org.kurento.commons.ClassPath類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。