本文整理汇总了Java中org.apache.jackrabbit.webdav.io.InputContext类的典型用法代码示例。如果您正苦于以下问题:Java InputContext类的具体用法?Java InputContext怎么用?Java InputContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputContext类属于org.apache.jackrabbit.webdav.io包,在下文中一共展示了InputContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
@Override
public void addMember( @Nullable DavResource davResource, @Nullable InputContext inputContext ) throws DavException {
if( !isDirectory ) {
throw new UnsupportedOperationException( "Not implemented: addMember to file" );
}
DavPath davPath = checkPath( davResource );
//DavSession session = davPath.getSession();
if( inputContext != null && inputContext.hasStream() ) { //session.isPutRequest() ) { // todo check
createFile( n1( inputContext ), davPath );
} else {
createDir( davPath );
}
}
开发者ID:openCage,项目名称:niodav,代码行数:19,代码来源:DavPath.java
示例2: populateItem
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/** */
protected void populateItem(InputContext inputContext)
throws CosmoDavException {
super.populateItem(inputContext);
ContentItem content = (ContentItem) getItem();
User user = getSecurityManager().getSecurityContext().getUser();
content.setLastModifiedBy(user != null ? user.getEmail() : "");
if (content.getUid() == null) {
content.setTriageStatus(TriageStatusUtil.initialize(content
.getFactory().createTriageStatus()));
content.setLastModification(ContentItem.Action.CREATED);
content.setSent(Boolean.FALSE);
content.setNeedsReply(Boolean.FALSE);
} else {
content.setLastModification(ContentItem.Action.EDITED);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:DavContentBase.java
示例3: createFile
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void createFile(final String fullFilePath, final InputContext inputContext) throws DavException {
if (cassandraDao.getFile(fullFilePath) != null) {
throw new DavException(DavServletResponse.SC_CONFLICT);
}
final String parentDirectory = getParentDirectory(fullFilePath);
final String fileName = PathUtils.getFileName(fullFilePath);
final UUID parentId = cassandraDao.getFile(parentDirectory);
try {
final UUID fileUUID = cassandraFileDao.createFile(parentId, fileName);
if (inputContext.hasStream() && inputContext.getContentLength() >= 0) {
final CountingInputStream countingInputStream = new CountingInputStream(inputContext.getInputStream());
cassandraFileDao.writeFile(fileUUID, countingInputStream);
cassandraFileDao.updateFileInfo(fileUUID, countingInputStream.getCount());
}
} catch (ConnectionException e) {
throw new RuntimeException(e);
}
}
开发者ID:Benky,项目名称:webdav-cassandra,代码行数:20,代码来源:FileStorageService.java
示例4: createFile
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
private void createFile( InputContext inputContext, DavPath fileResource ) throws DavException {
try( OutputStream out = Files.newOutputStream( fileResource.file ) ) {
if( inputContext.hasStream() ) {
IO.copy( inputContext.getInputStream(), out );
}
} catch( Exception e ) {
Log.warn( "create file problems " + file, e );
throw new DavException( DavServletResponse.SC_INTERNAL_SERVER_ERROR, e );
}
}
开发者ID:openCage,项目名称:niodav,代码行数:11,代码来源:DavPath.java
示例5: createInputContext
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/**
*
* @param request
* @return InputContext
* @throws CosmoDavException
* @throws IOException
*/
protected InputContext createInputContext(DavRequest request)
throws CosmoDavException, IOException {
String xfer = request.getHeader("Transfer-Encoding");
boolean chunked = xfer != null && xfer.equals("chunked");
if (xfer != null && ! chunked){
throw new BadRequestException("Unknown Transfer-Encoding " + xfer);
}
if (request.getContentLength() <= 0){
throw new BadRequestException("no content length set to input stream.");
}
return new DavInputContext(request, request.getInputStream());
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:BaseProvider.java
示例6: updateContent
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/**
* this method is added as an extension to cosmo, to allow updating an event based on ticket auth.
*
* @param content
* @param context
* @throws CosmoDavException
*/
public void updateContent(DavContent content, InputContext context) throws CosmoDavException {
if(!(content instanceof DavContentBase)){
throw new IllegalArgumentException("Expected type for 'content' member :[" + DavContentBase.class.getName()+"]");
}
DavContentBase base = (DavContentBase) content;
base.populateItem(context);
updateItem();
}
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:DavEvent.java
示例7: addContent
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void addContent(DavContent content, InputContext context) throws CosmoDavException {
if(!(content instanceof DavContentBase)) {
throw new IllegalArgumentException("Expected instance of : [" + DavContentBase.class.getName() + "]");
}
DavContentBase base = (DavContentBase) content;
base.populateItem(context);
saveContent(base);
members.add(base);
}
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:DavCollectionBase.java
示例8: populateItem
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
@Override
protected void populateItem(InputContext inputContext)
throws CosmoDavException {
super.populateItem(inputContext);
DavInputContext dic = (DavInputContext) inputContext;
Calendar calendar = dic.getCalendar();
setCalendar(calendar);
}
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:DavCalendarResource.java
示例9: populateItem
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/**
* Sets the properties of the item backing this resource from the given
* input context.
*/
protected void populateItem(InputContext inputContext)
throws CosmoDavException {
if (log.isDebugEnabled()) {
log.debug("populating item for " + getResourcePath());
}
if (item.getUid() == null) {
try {
item.setName(UrlEncoding.decode(PathUtil.getBasename(getResourcePath()), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new CosmoDavException(e);
}
if (item.getDisplayName() == null){
item.setDisplayName(item.getName());
}
}
// if we don't know specifically who the user is, then the
// owner of the resource becomes the person who issued the
// ticket
// Only initialize owner once
if (item.getOwner() == null) {
User owner = getSecurityManager().getSecurityContext().getUser();
if (owner == null) {
Ticket ticket = getSecurityManager().getSecurityContext()
.getTicket();
owner = ticket.getOwner();
}
item.setOwner(owner);
}
if (item.getUid() == null) {
item.setClientCreationDate(Calendar.getInstance().getTime());
item.setClientModifiedDate(item.getClientCreationDate());
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:42,代码来源:DavItemResourceBase.java
示例10: populateItem
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/** */
protected void populateItem(InputContext inputContext) throws CosmoDavException {
super.populateItem(inputContext);
CalendarCollectionStamp cc = getCalendarCollectionStamp();
try {
cc.setDescription(getItem().getName());
// XXX: language should come from the input context
} catch (DataSizeException e) {
throw new MaxResourceSizeException(e.getMessage());
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:14,代码来源:DavCalendarCollection.java
示例11: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
@Override
public void addMember(DavResource resource, InputContext inputContext) throws DavException {
final AbstractDavResource cassandraResource = (AbstractDavResource) resource;
final String destPath = cassandraResource.getPath();
if (cassandraResource.isCollection()) {
getCassandraService().createDirectory(destPath);
} else {
getFileStorageService().createFile(destPath, inputContext);
}
}
开发者ID:Benky,项目名称:webdav-cassandra,代码行数:11,代码来源:DavCollectionResource.java
示例12: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
@Override
public void addMember( DavResource arg0, InputContext arg1 )
throws DavException
{
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:ArchivaVirtualDavResource.java
示例13: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void addMember(org.apache.jackrabbit.webdav.DavResource member,
InputContext inputContext)
throws org.apache.jackrabbit.webdav.DavException {
throw new UnsupportedOperationException();
}
开发者ID:1and1,项目名称:cosmo,代码行数:6,代码来源:DavUserPrincipal.java
示例14: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void addMember(org.apache.jackrabbit.webdav.DavResource member, InputContext inputContext)
throws org.apache.jackrabbit.webdav.DavException {
throw new UnsupportedOperationException();
}
开发者ID:1and1,项目名称:cosmo,代码行数:5,代码来源:DavUserPrincipalCollection.java
示例15: addContent
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void addContent(DavContent content, InputContext context) throws CosmoDavException {
throw new UnsupportedOperationException();
}
开发者ID:1and1,项目名称:cosmo,代码行数:4,代码来源:DavUserPrincipalCollection.java
示例16: addContent
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/**
* Adds a new content item to this resource.
*/
void addContent(DavContent content,
InputContext input)
throws CosmoDavException;
开发者ID:1and1,项目名称:cosmo,代码行数:7,代码来源:DavCollection.java
示例17: addContent
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void addContent(DavContent content,
InputContext context)
throws CosmoDavException {
throw new UnsupportedOperationException();
}
开发者ID:1and1,项目名称:cosmo,代码行数:6,代码来源:DavOutboxCollection.java
示例18: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
public void addMember(org.apache.jackrabbit.webdav.DavResource member,
InputContext inputContext)
throws org.apache.jackrabbit.webdav.DavException {
throw new UnsupportedOperationException();
}
开发者ID:1and1,项目名称:cosmo,代码行数:6,代码来源:DavCollectionBase.java
示例19: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
/**
* Method is not allowed.
*/
public void addMember(DavResource resource, InputContext inputContext) throws DavException {
throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED, "Cannot add members to a non-collection resource");
}
开发者ID:Benky,项目名称:webdav-cassandra,代码行数:7,代码来源:DavFileResource.java
示例20: addMember
import org.apache.jackrabbit.webdav.io.InputContext; //导入依赖的package包/类
@Override
public void addMember(DavResource resource, InputContext inputContext) throws DavException {
}
开发者ID:Benky,项目名称:webdav-cassandra,代码行数:4,代码来源:DavNullResource.java
注:本文中的org.apache.jackrabbit.webdav.io.InputContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论