本文整理汇总了Java中org.javaswift.joss.model.Container.makePrivate方法的典型用法代码示例。如果您正苦于以下问题:Java Container.makePrivate方法的具体用法?Java Container.makePrivate怎么用?Java Container.makePrivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.javaswift.joss.model.Container
的用法示例。
在下文中一共展示了Container.makePrivate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContainer
import org.javaswift.joss.model.Container; //导入方法依赖的package包/类
/**
* {@inheritDoc}.
*/
@Override
public synchronized void createContainer(ContainerSpecification spec, SwiftCallback callback) {
CheckAccount () ;
if (spec != null) {
if (spec.getName().endsWith(SwiftUtils.segmentsContainerPostfix))
throw new AssertionError ("A container name cannot end with \"" + SwiftUtils.segmentsContainerPostfix + "\"") ;
Container c = account.getContainer(spec.getName());
if (!c.exists()) {
c.create();
if (spec.isPrivateContainer()) {
c.makePrivate();
} else {
c.makePublic();
}
}
callback.onUpdateContainers(eagerFetchContainers(account));
callback.onNumberOfCalls(account.getNumberOfCalls());
}
}
示例2: getSegmentsContainer
import org.javaswift.joss.model.Container; //导入方法依赖的package包/类
private Container getSegmentsContainer (StoredObject obj, boolean createIfNeeded)
{
String containerName = null ;
if (obj.exists())
{
String manifest = obj.getManifest() ;
if (manifest != null && !manifest.isEmpty())
{
// http://docs.openstack.org/api/openstack-object-storage/1.0/content/large-object-creation.html
// {container}/{prefix}
int index = manifest.indexOf(SwiftUtils.separator) ;
if (index > 0) {
containerName = manifest.substring(0, index) ;
}
}
}
if (containerName == null)
{
StringBuilder segmentsContainerName = new StringBuilder () ;
segmentsContainerName.append(((AbstractStoredObject)obj).getContainer().getName()) ;
segmentsContainerName.append(SwiftUtils.segmentsContainerPostfix) ;
containerName = segmentsContainerName.toString() ;
}
else
logger.info("Segment objects container obtained from the manifest: " + containerName) ;
Container segmentsContainer = account.getContainer(containerName) ;
if (createIfNeeded && !segmentsContainer.exists())
{
segmentsContainer.create() ;
segmentsContainer.makePrivate();
}
return segmentsContainer ;
}