Skip to content

Commit

Permalink
4.7.4603
Browse files Browse the repository at this point in the history
  • Loading branch information
ITHitBuild committed Mar 10, 2021
1 parent de38261 commit d9d30be
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 85 deletions.
6 changes: 3 additions & 3 deletions Java/androidfsstorage/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
jarJar {
rules = [
'stax-api-1.0.1.jar' : 'javax.xml.** com.ithit.webdav.xml.@1',
'webdav-server-4.7.4551.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
'webdav-server-4.7.4603.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
]
}

Expand Down Expand Up @@ -71,11 +71,11 @@ dependencies {
implementation 'commons-io:commons-io:2.4'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation('com.ithit.webdav.integration:android-integration:4.7.4551', {
implementation('com.ithit.webdav.integration:android-integration:4.7.4603', {
exclude group: 'org.nanohttpd', module: 'nanohttpd'
})
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
jarJar 'stax:stax-api:1.0.1'
jarJar 'com.ithit.webdav:webdav-server:4.7.4551'
jarJar 'com.ithit.webdav:webdav-server:4.7.4603'
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ public String getEtag() throws ServerException {
* @param count Number of bytes to be written to the output stream.
* @throws ServerException In case of an error.
*/
// <<<< readFileImpl
@Override
public void read(OutputStream out, long startIndex, long count) throws ServerException {
java.io.File fullPath = FileUtils.getFile(this.getFullPath());
Expand All @@ -222,7 +221,6 @@ public void read(OutputStream out, long startIndex, long count) throws ServerExc
IOUtils.closeQuietly(in);
}
}
// readFileImpl >>>>

/**
* Saves the content of the file from the specified stream to the File System repository.
Expand All @@ -236,7 +234,6 @@ public void read(OutputStream out, long startIndex, long count) throws ServerExc
* @throws ServerException In case of an error.
* @throws IOException I/O error.
*/
// <<<< writeFileImpl
@Override
public long write(InputStream content, String contentType, long startIndex, long totalFileLength)
throws LockedException, ServerException, IOException {
Expand All @@ -257,7 +254,6 @@ public long write(InputStream content, String contentType, long startIndex, long
IOUtils.closeQuietly(fos);
}
}
// writeFileImpl >>>>

private void incrementSerialNumber() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ private static String fixPath(String path) {
* @throws LockedException This folder was locked. Client did not provide the lock token.
* @throws ServerException In case of an error.
*/
// <<<< createFileImpl
@Override
public FileImpl createFile(String name) throws LockedException, ServerException {
ensureHasToken();
Expand All @@ -99,7 +98,6 @@ public FileImpl createFile(String name) throws LockedException, ServerException
}
return null;
}
// createFileImpl >>>>

/**
* Creates new {@link FolderImpl} folder with the specified name in this folder.
Expand All @@ -108,7 +106,6 @@ public FileImpl createFile(String name) throws LockedException, ServerException
* @throws LockedException This folder was locked. Client did not provide the lock token.
* @throws ServerException In case of an error.
*/
// <<<< createFolderImpl
@Override
public void createFolder(String name) throws LockedException,
ServerException {
Expand All @@ -119,7 +116,6 @@ public void createFolder(String name) throws LockedException,
fullPath.mkdir();
}
}
// createFolderImpl >>>>

/**
* Gets the array of this folder's children.
Expand All @@ -131,7 +127,6 @@ public void createFolder(String name) throws LockedException,
* @return Instance of {@link PageResults} class that contains items on a requested page and total number of items in a folder.
* @throws ServerException In case of an error.
*/
// <<<< getChildren
@Override
public PageResults getChildren(List<Property> propNames, Long offset, Long nResults, List<OrderProperty> orderProps) throws ServerException {
String decodedPath = HierarchyItemImpl.decodeAndConvertToPath(getPath());
Expand All @@ -148,9 +143,7 @@ public PageResults getChildren(List<Property> propNames, Long offset, Long nResu
}
return new PageResults(children, null);
}
// getChildren >>>>

// <<<< deleteFolderImpl
@Override
public void delete() throws LockedException, MultistatusException,
ServerException {
Expand All @@ -161,9 +154,7 @@ public void delete() throws LockedException, MultistatusException,
throw new ServerException(e);
}
}
// deleteFolderImpl >>>>

// <<<< copyToFolderImpl
@Override
public void copyTo(Folder folder, String destName, boolean deep)
throws LockedException, MultistatusException, ServerException {
Expand All @@ -185,7 +176,6 @@ public void copyTo(Folder folder, String destName, boolean deep)
}
setName(destName);
}
// copyToFolderImpl >>>>

/**
* Check whether current folder is the parent to the destination.
Expand All @@ -198,7 +188,6 @@ private boolean isRecursive(String destFolder) throws ServerException {
return destFolder.startsWith(getPath().replace("/", java.io.File.separator));
}

// <<<< moveToFolderImpl
@Override
public void moveTo(Folder folder, String destName) throws LockedException,
ConflictException, MultistatusException, ServerException {
Expand All @@ -217,7 +206,6 @@ public void moveTo(Folder folder, String destName) throws LockedException,
}
setName(destName);
}
// moveToFolderImpl >>>>

/**
* Returns free bytes available to current user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ public String getPath() throws ServerException {
* @return List of properties with values set. If property cannot be found it shall be omitted from the result.
* @throws ServerException In case of an error.
*/
// <<<< getPropertiesImpl
@Override
public List<Property> getProperties(Property[] props) throws ServerException {
List<Property> l = getPropertyNames();
Expand All @@ -228,7 +227,6 @@ public List<Property> getProperties(Property[] props) throws ServerException {
}
return result;
}
// getPropertiesImpl >>>>


private List<Property> getProperties() throws ServerException {
Expand All @@ -245,7 +243,6 @@ private List<Property> getProperties() throws ServerException {
* @return List of all property names for this item.
* @throws ServerException In case of an error.
*/
// <<<< getPropertyNamesImpl
@Override
public List<Property> getPropertyNames() throws ServerException {
if (ExtendedAttributesExtension.hasExtendedAttribute(getFullPath(), propertiesAttribute)) {
Expand All @@ -254,7 +251,6 @@ public List<Property> getPropertyNames() throws ServerException {
}
return new LinkedList<>();
}
// getPropertyNamesImpl >>>>

/**
* Check whether client is the lock owner.
Expand Down Expand Up @@ -299,7 +295,6 @@ private boolean clientHasToken() throws ServerException {
* result of the operation for each property.
* @throws ServerException In case of other error.
*/
// <<<< updatePropertiesImpl
@Override
public void updateProperties(Property[] setProps, Property[] delProps)
throws LockedException, MultistatusException, ServerException {
Expand Down Expand Up @@ -345,7 +340,6 @@ public void updateProperties(Property[] setProps, Property[] delProps)
}
ExtendedAttributesExtension.setExtendedAttribute(getFullPath(), propertiesAttribute, SerializationUtils.serialize(propToLeft));
}
// updatePropertiesImpl >>>>

/**
* Updates basic file times in the following format - Thu, 28 Mar 2013 20:15:34 GMT.
Expand Down Expand Up @@ -392,7 +386,6 @@ String getFullPath() {
* @throws MultistatusException Errors have occurred during processing of the subtree.
* @throws ServerException In case of an error.
*/
// <<<< lockImpl
@Override
public LockResult lock(boolean shared, boolean deep, long timeout, String owner)
throws LockedException, MultistatusException, ServerException {
Expand All @@ -411,7 +404,6 @@ public LockResult lock(boolean shared, boolean deep, long timeout, String owner)
ExtendedAttributesExtension.setExtendedAttribute(getFullPath(), activeLocksAttribute, SerializationUtils.serialize(activeLocks));
return new LockResult(token, timeout);
}
// lockImpl >>>>

/**
* Checks whether {@link HierarchyItemImpl} has a lock and whether it is shared.
Expand All @@ -431,7 +423,6 @@ private boolean hasLock(boolean skipShared) throws ServerException {
* @return Array of locks.
* @throws ServerException In case of an error.
*/
// <<<< getActiveLocksImpl
@Override
public List<LockInfo> getActiveLocks() throws ServerException {
if (activeLocks == null) {
Expand All @@ -448,7 +439,6 @@ public List<LockInfo> getActiveLocks() throws ServerException {
}
return activeLocks;
}
// getActiveLocksImpl >>>>

/**
* Removes lock with the specified token from this item.
Expand All @@ -457,7 +447,6 @@ public List<LockInfo> getActiveLocks() throws ServerException {
* @throws PreconditionFailedException Included lock token was not enforceable on this item.
* @throws ServerException In case of an error.
*/
// <<<< unlockImpl
@Override
public void unlock(String lockToken) throws PreconditionFailedException,
ServerException {
Expand All @@ -480,7 +469,6 @@ public void unlock(String lockToken) throws PreconditionFailedException,
throw new PreconditionFailedException();
}
}
// unlockImpl >>>>

/**
* Updates lock timeout information on this item.
Expand All @@ -491,7 +479,6 @@ public void unlock(String lockToken) throws PreconditionFailedException,
* @throws PreconditionFailedException Included lock token was not enforceable on this item.
* @throws ServerException In case of an error.
*/
// <<<< refreshLockImpl
@Override
public RefreshLockResult refreshLock(String token, long timeout)
throws PreconditionFailedException, ServerException {
Expand All @@ -517,6 +504,5 @@ public RefreshLockResult refreshLock(String token, long timeout)
return new RefreshLockResult(lockInfo.isShared(), lockInfo.isDeep(),
timeout, lockInfo.getOwner());
}
// refreshLockImpl >>>>

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class WebDavEngine extends Engine {
* @return Instance of corresponding {@link HierarchyItem} or null if item is not found.
* @throws ServerException in case if cannot read file attributes.
*/
// <<<< getHierarchyItemEngine
@Override
public HierarchyItem getHierarchyItem(String contextPath) throws ServerException {
int i = contextPath.indexOf("?");
Expand All @@ -52,7 +51,6 @@ public HierarchyItem getHierarchyItem(String contextPath) throws ServerException
getLogger().logDebug("Could not find item that corresponds to path: " + contextPath);
return null; // no hierarchy item that corresponds to path parameter was found in the repository
}
// getHierarchyItemEngine >>>>

/**
* Returns logger that will be used by engine.
Expand Down
10 changes: 5 additions & 5 deletions Java/deltav/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ithit.webdav.samples</groupId>
<artifactId>deltav</artifactId>
<version>4.7.4551</version>
<version>4.7.4603</version>
<packaging>war</packaging>

<properties>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>com.ithit.webdav.integration</groupId>
<artifactId>servlet-integration</artifactId>
<version>4.7.4551</version>
<version>4.7.4603</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
Expand Down Expand Up @@ -125,7 +125,7 @@
<dependency>
<groupId>com.ithit.webdav</groupId>
<artifactId>webdav-server</artifactId>
<version>4.7.4551</version>
<version>4.7.4603</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -165,7 +165,7 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/deltav-4.7.4551/META-INF</outputDirectory>
<outputDirectory>${project.build.directory}/deltav-4.7.4603/META-INF</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
Expand Down Expand Up @@ -244,7 +244,7 @@
<server>filesystem</server>
<port>11021</port>
<path>/</path>
<warSourceDirectory>target/deltav-4.7.4551</warSourceDirectory>
<warSourceDirectory>target/deltav-4.7.4603</warSourceDirectory>
</configuration>
</plugin>
<plugin>
Expand Down
8 changes: 4 additions & 4 deletions Java/filesystemstorage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ithit.webdav.samples</groupId>
<artifactId>filesystemstorage</artifactId>
<version>4.7.4551</version>
<version>4.7.4603</version>
<packaging>war</packaging>

<properties>
Expand Down Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>com.ithit.webdav.integration</groupId>
<artifactId>servlet-integration</artifactId>
<version>4.7.4551</version>
<version>4.7.4603</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -142,7 +142,7 @@
<dependency>
<groupId>com.ithit.webdav</groupId>
<artifactId>webdav-server</artifactId>
<version>4.7.4551</version>
<version>4.7.4603</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
Expand Down Expand Up @@ -228,7 +228,7 @@
<server>filesystem</server>
<port>11021</port>
<path>/</path>
<warSourceDirectory>target/filesystemstorage-4.7.4551</warSourceDirectory>
<warSourceDirectory>target/filesystemstorage-4.7.4603</warSourceDirectory>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.ithit.webdav.server.exceptions.ServerException;
import com.ithit.webdav.server.resumableupload.ResumableUpload;
import com.ithit.webdav.server.resumableupload.UploadProgress;
import com.sun.nio.file.ExtendedOpenOption;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -51,7 +50,20 @@ private FileImpl(String name, String path, long created, long modified, WebDavEn
this.allowedOpenFileOptions = (systemName.contains("mac") || systemName.contains("linux")) ?
(new OpenOption[]{StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.READ}) :
(new OpenOption[]{StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.READ,
ExtendedOpenOption.NOSHARE_DELETE});
noShareDeleteOption()});
}

/**
* Load ExtendedOpenOption with reflection without direct reference - because most of Linux/MacOS jdks don't have it and not required.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
private OpenOption noShareDeleteOption() {
try {
Class enumClass = Class.forName("com.sun.nio.file.ExtendedOpenOption");
return (OpenOption) Enum.valueOf(enumClass, "NOSHARE_DELETE");
} catch (ClassNotFoundException e) {
return StandardOpenOption.READ;
}
}

/**
Expand Down
Loading

0 comments on commit d9d30be

Please sign in to comment.