2013-06-24 53 views
1

jclouds是否有任何可以使用「屬性」文件覆蓋org.jclouds.Constants中的屬性的機制?屬性可以用代碼設置,但如果您通過jclouds-cli使用jcloud,那麼這不是有用的。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();