// DAVFrame.java
// $Id: DAVFrame.java,v 1.39 2007/02/09 22:45:42 ylafon Exp $
// (c) COPYRIGHT MIT, INRIA and Keio, 2000.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.jigsaw.webdav;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.ListIterator;
import java.util.LinkedList;
import java.util.Vector;
import org.xml.sax.SAXException;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.jigsaw.auth.AuthFilter;
import org.w3c.jigsaw.frames.PostableFrame;
import org.w3c.jigsaw.http.HTTPException;
import org.w3c.jigsaw.http.Reply;
import org.w3c.jigsaw.http.Request;
import org.w3c.www.http.ContentLengthInputStream;
import org.w3c.tools.codec.Base64Decoder;
import org.w3c.tools.codec.Base64Encoder;
import org.w3c.tools.codec.Base64FormatException;
import org.w3c.tools.resources.Attribute;
import org.w3c.tools.resources.AttributeRegistry;
import org.w3c.tools.resources.ContainerResource;
import org.w3c.tools.resources.DateAttribute;
import org.w3c.tools.resources.DirectoryResource;
import org.w3c.tools.resources.FramedResource;
import org.w3c.tools.resources.IntegerAttribute;
import org.w3c.tools.resources.InvalidResourceException;
import org.w3c.tools.resources.LookupResult;
import org.w3c.tools.resources.LookupState;
import org.w3c.tools.resources.ProtocolException;
import org.w3c.tools.resources.PropertiesAttribute;
import org.w3c.tools.resources.RequestInterface;
import org.w3c.tools.resources.ReplyInterface;
import org.w3c.tools.resources.Resource;
import org.w3c.tools.resources.ResourceException;
import org.w3c.tools.resources.ResourceFrame;
import org.w3c.tools.resources.ResourceReference;
import org.w3c.tools.resources.ServerInterface;
import org.w3c.tools.resources.StringAttribute;
import org.w3c.util.ArrayDictionary;
import org.w3c.util.DateParser;
import org.w3c.util.InvalidDateException;
import org.w3c.util.ObservableProperties;
import org.w3c.util.URLUtils;
import org.w3c.www.http.HeaderDescription;
import org.w3c.www.http.HeaderValue;
import org.w3c.www.http.HTTP;
import org.w3c.www.http.HttpDate;
import org.w3c.www.http.HttpEntityTag;
import org.w3c.www.http.HttpFactory;
import org.w3c.www.http.HttpInvalidValueException;
import org.w3c.www.http.HttpMimeType;
import org.w3c.www.http.HttpMessage;
import org.w3c.www.http.HttpReplyMessage;
import org.w3c.www.http.HttpRequestMessage;
import org.w3c.www.http.HttpTokenList;
import org.w3c.www.mime.MimeType;
import org.w3c.www.mime.MimeTypeFormatException;
import org.w3c.www.webdav.WEBDAV;
import org.w3c.www.webdav.DAVEntityTag;
import org.w3c.www.webdav.DAVIf;
import org.w3c.www.webdav.DAVParser;
import org.w3c.www.webdav.DAVStateToken;
import org.w3c.www.webdav.xml.DAVBody;
import org.w3c.www.webdav.xml.DAVFactory;
import org.w3c.www.webdav.xml.DAVLockInfo;
import org.w3c.www.webdav.xml.DAVMultiStatus;
import org.w3c.www.webdav.xml.DAVNode;
import org.w3c.www.webdav.xml.DAVPropAction;
import org.w3c.www.webdav.xml.DAVPropertyBehavior;
import org.w3c.www.webdav.xml.DAVPropFind;
import org.w3c.www.webdav.xml.DAVPropStat;
import org.w3c.www.webdav.xml.DAVProperties;
import org.w3c.www.webdav.xml.DAVPropertyUpdate;
import org.w3c.www.webdav.xml.DAVResponse;
/**
* @version $Revision: 1.39 $
* @author Beno�t Mah� (bmahe@w3.org)
*/
public class DAVFrame extends PostableFrame {
public static final boolean debug = false;
public static final boolean debugxml = false;
/**
* Condition check return code - Condition existed and succeeded.
* And lock has been checked
*/
public static final int COND_OK_LOCK = 3;
/**
* Cached mime type
*/
protected static HttpMimeType xmlcontenttype = null;
protected static HttpMimeType collectioncontenttype = null;
protected static boolean isReadOnly(String propname) {
return (propname.equals(DAVNode.CREATIONDATE_NODE) ||
propname.equals(DAVNode.GETCONTENTLENGTH_NODE) ||
propname.equals(DAVNode.GETETAG_NODE) ||
propname.equals(DAVNode.GETLASTMODIFIED_NODE));
}
protected static boolean acceptRedirect(DAVRequest request) {
String method = request.getMethod();
return ! (method.equals("PROPPATCH") ||
method.equals("PROPFIND") ||
method.equals("COPY") ||
method.equals("MOVE") ||
method.equals("DELETE") ||
method.equals("LOCK") ||
method.equals("UNLOCK"));
}
/**
* The DAVManager we use.
*/
protected org.w3c.www.protocol.webdav.DAVManager manager = null;
/**
* Name ot the state to hold the remaining path (used with MKCOL)
*/
public final static String REMAINING_PATH = "org.w3c.jigsaw.webdav.rpath";
public final static String LOCK_USERNAME = "org.w3c.jigsaw.webdav.user";
public final static String LOCK_TOKEN = "org.w3c.jigsaw.webdav.token";
public final static String LOCK_OWNER = "org.w3c.jigsaw.webdav.owner";
public final static String LOCK_EXPIRE = "org.w3c.jigsaw.webdav.expire";
public final static String LOCK_TIMEOUT = "org.w3c.jigsaw.webdav.timeout";
public final static String LOCKED_REREFENCE
= "org.w3c.jigsaw.webdav.reference";
public final static Long DEFAULT_LOCK_TIMEOUT =
new Long(24 * 60 * 60 * 1000); // 1 day
public final static Long MAX_LOCK_TIMEOUT =
new Long(7 * 24 * 60 * 60 * 1000); // 1 week
/**
* Attribute index - The index for the creation date attribute.
*/
protected static int ATTR_CREATION_DATE = -1 ;
/**
* Attribute index - The index for the dead properties
*/
protected static int ATTR_DEAD_PROPERTIES = -1 ;
/**
* Attribute index - The index for the lock token
*/
protected static int ATTR_LOCK_TOKEN = -1 ;
/**
* Attribute index - The index for the lock token
*/
protected static int ATTR_LOCK_TIMEOUT = -1 ;
/**
* Attribute index - The index for the lock date
*/
protected static int ATTR_LOCK_DATE = -1 ;
/**
* Attribute index - The index for the lock depth
*/
protected static int ATTR_LOCK_DEPTH = -1 ;
/**
* Attribute index - The index for the lock owner
*/
protected static int ATTR_LOCK_OWNER = -1 ;
/**
* Attribute index - The index for the lock username
*/
protected static int ATTR_LOCK_USERNAME = -1 ;
static {
Class cls = null ;
// Get a pointer to our own class:
try {
cls = Class.forName("org.w3c.jigsaw.webdav.DAVFrame") ;
} catch (Exception ex) {
ex.printStackTrace() ;
System.exit(1) ;
}
// Our creation date
Attribute a = new DateAttribute("creation-date",
null,
Attribute.COMPUTED) ;
ATTR_CREATION_DATE = AttributeRegistry.registerAttribute(cls,a);
// Our creation date
a = new PropertiesAttribute("dead-properties",
null,
Attribute.COMPUTED) ;
ATTR_DEAD_PROPERTIES = AttributeRegistry.registerAttribute(cls,a);
// Our lock token (if any)
a = new StringAttribute("lock-token",
null,
Attribute.COMPUTED) ;
ATTR_LOCK_TOKEN = AttributeRegistry.registerAttribute(cls,a);
// Our timeout token (if any)
a = new DateAttribute("lock-timeout",
null,
Attribute.COMPUTED) ;
ATTR_LOCK_TIMEOUT = AttributeRegistry.registerAttribute(cls,a);
// Our lock token date
a = new DateAttribute("lock-date",
null,
Attribute.COMPUTED) ;
ATTR_LOCK_DATE = AttributeRegistry.registerAttribute(cls,a);
// Our expire token (if any)
a = new IntegerAttribute("lock-depth",
null,
Attribute.COMPUTED) ;
ATTR_LOCK_DEPTH = AttributeRegi
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
w3c的HTTP实现(java) (2000个子文件)
libUnix.c 3KB
libUnix.c 3KB
jigsaw.css 8KB
jigsaw2.css 5KB
doc.css 5KB
stylesheet.css 1KB
default-html.css 688B
style-font-lock.css 688B
directory.css 357B
org_w3c_util_Unix.h 1KB
index-all.html 2.76MB
constant-values.html 329KB
DAVFrame.html 190KB
overview-tree.html 167KB
HTTPFrame.html 154KB
serialized-form.html 149KB
HttpMessage.html 134KB
httpd.html 124KB
HTTPFrame.html 123KB
allclasses-frame.html 109KB
RelNotes.html 98KB
HttpRequestMessage.html 96KB
allclasses-noframe.html 94KB
CvsDirectory.html 87KB
CvsDAVFileFrame.html 83KB
HttpFactory.html 81KB
CachedResource.html 80KB
CvsDAVDirectoryFrame.html 77KB
HttpReplyMessage.html 75KB
Request.html 75KB
NegotiatedFrame.html 72KB
FramedResource.html 71KB
JigsawHttpServletRequest.html 71KB
HttpManager.html 70KB
CvsFrame.html 69KB
PageCompileFrame.html 69KB
BrokerFrame.html 68KB
PutListResource.html 68KB
EntityCachedResource.html 68KB
CacheStore.html 66KB
ResourceStoreManager.html 66KB
Reply.html 66KB
JpegComFrame.html 65KB
DirectoryResource.html 65KB
CgiFrame.html 64KB
ContainerResource.html 64KB
DAVNode.html 63KB
ForwardFrame.html 63KB
Request.html 63KB
JpegXMPFrame.html 63KB
ResourceTreeBrowser.html 62KB
Resource.html 61KB
HttpBasicServer.html 61KB
SSIFrame.html 61KB
JigsawHttpServletResponse.html 60KB
CvsFileFrame.html 60KB
DAVRequest.html 60KB
RelocateFrame.html 59KB
CacheFilter.html 59KB
ToolsListerFrame.html 59KB
ServletWrapper.html 59KB
SampleResourceIndexer.html 59KB
ResourceFrame.html 58KB
MirrorFrame.html 57KB
HttpEntityMessage.html 56KB
GeneratedFrame.html 55KB
DAVReply.html 55KB
ResourceFilter.html 55KB
ProxyFrame.html 54KB
DigestAuthFilter.html 53KB
PutListFrame.html 53KB
ProxyExtFrame.html 53KB
HTTPExtFrame.html 53KB
PostableFrame.html 52KB
CCPPFrame.html 52KB
AclFilter.html 52KB
ServletDirectoryFrame.html 52KB
PasswordEditorFrame.html 52KB
PlainRemoteResource.html 52KB
Reply.html 51KB
GenericAuthFilter.html 51KB
ZipFrame.html 51KB
ZipDirectoryResource.html 50KB
LabelBureauFrame.html 50KB
RedirecterFrame.html 50KB
DAVReply.html 50KB
PushReply.html 50KB
ServletWrapperFrame.html 50KB
AclRealm.html 50KB
JigsawServletContext.html 50KB
ControlServerHelper.html 50KB
JdbcBeanSerializer.html 49KB
ThreadStatFrame.html 49KB
ServletMapperFrame.html 49KB
FancyFrame.html 49KB
LogFilter.html 49KB
SSLProperties.html 48KB
DAVRequest.html 48KB
VirtualHostFrame.html 48KB
AutoLookupDirectory.html 48KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
zxmzfbdc
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功