Apply patch for VFS-259
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/vfs/branches/VFS281@834372 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java b/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
index b4fb911..dd6948b 100644
--- a/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
+++ b/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
@@ -24,6 +24,7 @@
import org.apache.commons.vfs.FileContentInfoFactory;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.impl.DefaultFileContentInfo;
+import org.apache.commons.vfs.util.FileObjectUtils;
/**
* Description
@@ -35,7 +36,8 @@
{
public FileContentInfo create(FileContent fileContent) throws FileSystemException
{
- HttpFileObject httpFile = (HttpFileObject) fileContent.getFile();
+ HttpFileObject httpFile = (HttpFileObject) (FileObjectUtils
+ .getAbstractFileObject(fileContent.getFile()));
String contentType = null;
String contentEncoding = null;
diff --git a/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java b/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java
index 2a5dc36..9a288de 100644
--- a/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java
+++ b/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java
@@ -22,6 +22,7 @@
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.impl.DefaultFileContentInfo;
import org.apache.commons.vfs.provider.URLFileName;
+import org.apache.commons.vfs.util.FileObjectUtils;
import org.apache.jackrabbit.webdav.property.DavProperty;
import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
@@ -37,7 +38,8 @@
{
public FileContentInfo create(FileContent fileContent) throws FileSystemException
{
- WebdavFileObject file = (WebdavFileObject) fileContent.getFile();
+ WebdavFileObject file = (WebdavFileObject) (FileObjectUtils
+ .getAbstractFileObject(fileContent.getFile()));
String contentType = null;
String contentEncoding = null;
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 1c5d422..bec2e34 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -23,6 +23,9 @@
<body>
<release version="2.0" date="in SVN" description="">
+ <action dev="rgoers" type="fix" issue="VFS-259" due-to="Marek Zawirski">
+ Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting
+ </action>
<action dev="rgoers" type="fix" issue="VFS-261" due-to="Simon Olofsson">
WebDAV upload corrupts binary files
</action>