2013-06-24 5 views
1

jclouds에는 "properties"파일을 사용하여 org.jclouds.Constants의 속성을 덮어 쓸 수있는 메커니즘이 있습니까? 속성은 코드에서 설정할 수 있지만 jclouds에서 jclouds-cli까지 사용하는 경우에는 유용하지 않습니다.jclouds의 등록 정보 파일 메커니즘?

답변

1

당신은 ContextBuilder.overrides를 통해 속성을 제공 할 수 있습니다

Properties properties = new Properties(); 
try (InputStream is = new FileInputStream(new File(...))) { 
    properties.load(is); 
} 

BlobStoreContext blobStoreContext = ContextBuilder 
    .newBuilder(BLOBSTORE_TYPE) 
    .credentials(IDENTITY, CREDENTIAL) 
    .overrides(properties) 
    .build();