Skip to content

Commit d9d30be

Browse files
committed
4.7.4603
1 parent de38261 commit d9d30be

File tree

16 files changed

+55
-85
lines changed

16 files changed

+55
-85
lines changed

Java/androidfsstorage/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ android {
3030
jarJar {
3131
rules = [
3232
'stax-api-1.0.1.jar' : 'javax.xml.** com.ithit.webdav.xml.@1',
33-
'webdav-server-4.7.4551.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
33+
'webdav-server-4.7.4603.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
3434
]
3535
}
3636

@@ -71,11 +71,11 @@ dependencies {
7171
implementation 'commons-io:commons-io:2.4'
7272
implementation 'com.google.code.gson:gson:2.7'
7373
implementation 'com.android.support:appcompat-v7:27.1.1'
74-
implementation('com.ithit.webdav.integration:android-integration:4.7.4551', {
74+
implementation('com.ithit.webdav.integration:android-integration:4.7.4603', {
7575
exclude group: 'org.nanohttpd', module: 'nanohttpd'
7676
})
7777
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
7878
jarJar 'stax:stax-api:1.0.1'
79-
jarJar 'com.ithit.webdav:webdav-server:4.7.4551'
79+
jarJar 'com.ithit.webdav:webdav-server:4.7.4603'
8080
testImplementation 'junit:junit:4.12'
8181
}

Java/androidfsstorage/app/src/main/java/com/ithit/webdav/samples/androidfsstorage/FileImpl.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ public String getEtag() throws ServerException {
197197
* @param count Number of bytes to be written to the output stream.
198198
* @throws ServerException In case of an error.
199199
*/
200-
// <<<< readFileImpl
201200
@Override
202201
public void read(OutputStream out, long startIndex, long count) throws ServerException {
203202
java.io.File fullPath = FileUtils.getFile(this.getFullPath());
@@ -222,7 +221,6 @@ public void read(OutputStream out, long startIndex, long count) throws ServerExc
222221
IOUtils.closeQuietly(in);
223222
}
224223
}
225-
// readFileImpl >>>>
226224

227225
/**
228226
* Saves the content of the file from the specified stream to the File System repository.
@@ -236,7 +234,6 @@ public void read(OutputStream out, long startIndex, long count) throws ServerExc
236234
* @throws ServerException In case of an error.
237235
* @throws IOException I/O error.
238236
*/
239-
// <<<< writeFileImpl
240237
@Override
241238
public long write(InputStream content, String contentType, long startIndex, long totalFileLength)
242239
throws LockedException, ServerException, IOException {
@@ -257,7 +254,6 @@ public long write(InputStream content, String contentType, long startIndex, long
257254
IOUtils.closeQuietly(fos);
258255
}
259256
}
260-
// writeFileImpl >>>>
261257

262258
private void incrementSerialNumber() {
263259
try {

Java/androidfsstorage/app/src/main/java/com/ithit/webdav/samples/androidfsstorage/FolderImpl.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ private static String fixPath(String path) {
8383
* @throws LockedException This folder was locked. Client did not provide the lock token.
8484
* @throws ServerException In case of an error.
8585
*/
86-
// <<<< createFileImpl
8786
@Override
8887
public FileImpl createFile(String name) throws LockedException, ServerException {
8988
ensureHasToken();
@@ -99,7 +98,6 @@ public FileImpl createFile(String name) throws LockedException, ServerException
9998
}
10099
return null;
101100
}
102-
// createFileImpl >>>>
103101

104102
/**
105103
* Creates new {@link FolderImpl} folder with the specified name in this folder.
@@ -108,7 +106,6 @@ public FileImpl createFile(String name) throws LockedException, ServerException
108106
* @throws LockedException This folder was locked. Client did not provide the lock token.
109107
* @throws ServerException In case of an error.
110108
*/
111-
// <<<< createFolderImpl
112109
@Override
113110
public void createFolder(String name) throws LockedException,
114111
ServerException {
@@ -119,7 +116,6 @@ public void createFolder(String name) throws LockedException,
119116
fullPath.mkdir();
120117
}
121118
}
122-
// createFolderImpl >>>>
123119

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

153-
// <<<< deleteFolderImpl
154147
@Override
155148
public void delete() throws LockedException, MultistatusException,
156149
ServerException {
@@ -161,9 +154,7 @@ public void delete() throws LockedException, MultistatusException,
161154
throw new ServerException(e);
162155
}
163156
}
164-
// deleteFolderImpl >>>>
165157

166-
// <<<< copyToFolderImpl
167158
@Override
168159
public void copyTo(Folder folder, String destName, boolean deep)
169160
throws LockedException, MultistatusException, ServerException {
@@ -185,7 +176,6 @@ public void copyTo(Folder folder, String destName, boolean deep)
185176
}
186177
setName(destName);
187178
}
188-
// copyToFolderImpl >>>>
189179

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

201-
// <<<< moveToFolderImpl
202191
@Override
203192
public void moveTo(Folder folder, String destName) throws LockedException,
204193
ConflictException, MultistatusException, ServerException {
@@ -217,7 +206,6 @@ public void moveTo(Folder folder, String destName) throws LockedException,
217206
}
218207
setName(destName);
219208
}
220-
// moveToFolderImpl >>>>
221209

222210
/**
223211
* Returns free bytes available to current user.

Java/androidfsstorage/app/src/main/java/com/ithit/webdav/samples/androidfsstorage/HierarchyItemImpl.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ public String getPath() throws ServerException {
208208
* @return List of properties with values set. If property cannot be found it shall be omitted from the result.
209209
* @throws ServerException In case of an error.
210210
*/
211-
// <<<< getPropertiesImpl
212211
@Override
213212
public List<Property> getProperties(Property[] props) throws ServerException {
214213
List<Property> l = getPropertyNames();
@@ -228,7 +227,6 @@ public List<Property> getProperties(Property[] props) throws ServerException {
228227
}
229228
return result;
230229
}
231-
// getPropertiesImpl >>>>
232230

233231

234232
private List<Property> getProperties() throws ServerException {
@@ -245,7 +243,6 @@ private List<Property> getProperties() throws ServerException {
245243
* @return List of all property names for this item.
246244
* @throws ServerException In case of an error.
247245
*/
248-
// <<<< getPropertyNamesImpl
249246
@Override
250247
public List<Property> getPropertyNames() throws ServerException {
251248
if (ExtendedAttributesExtension.hasExtendedAttribute(getFullPath(), propertiesAttribute)) {
@@ -254,7 +251,6 @@ public List<Property> getPropertyNames() throws ServerException {
254251
}
255252
return new LinkedList<>();
256253
}
257-
// getPropertyNamesImpl >>>>
258254

259255
/**
260256
* Check whether client is the lock owner.
@@ -299,7 +295,6 @@ private boolean clientHasToken() throws ServerException {
299295
* result of the operation for each property.
300296
* @throws ServerException In case of other error.
301297
*/
302-
// <<<< updatePropertiesImpl
303298
@Override
304299
public void updateProperties(Property[] setProps, Property[] delProps)
305300
throws LockedException, MultistatusException, ServerException {
@@ -345,7 +340,6 @@ public void updateProperties(Property[] setProps, Property[] delProps)
345340
}
346341
ExtendedAttributesExtension.setExtendedAttribute(getFullPath(), propertiesAttribute, SerializationUtils.serialize(propToLeft));
347342
}
348-
// updatePropertiesImpl >>>>
349343

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

416408
/**
417409
* Checks whether {@link HierarchyItemImpl} has a lock and whether it is shared.
@@ -431,7 +423,6 @@ private boolean hasLock(boolean skipShared) throws ServerException {
431423
* @return Array of locks.
432424
* @throws ServerException In case of an error.
433425
*/
434-
// <<<< getActiveLocksImpl
435426
@Override
436427
public List<LockInfo> getActiveLocks() throws ServerException {
437428
if (activeLocks == null) {
@@ -448,7 +439,6 @@ public List<LockInfo> getActiveLocks() throws ServerException {
448439
}
449440
return activeLocks;
450441
}
451-
// getActiveLocksImpl >>>>
452442

453443
/**
454444
* Removes lock with the specified token from this item.
@@ -457,7 +447,6 @@ public List<LockInfo> getActiveLocks() throws ServerException {
457447
* @throws PreconditionFailedException Included lock token was not enforceable on this item.
458448
* @throws ServerException In case of an error.
459449
*/
460-
// <<<< unlockImpl
461450
@Override
462451
public void unlock(String lockToken) throws PreconditionFailedException,
463452
ServerException {
@@ -480,7 +469,6 @@ public void unlock(String lockToken) throws PreconditionFailedException,
480469
throw new PreconditionFailedException();
481470
}
482471
}
483-
// unlockImpl >>>>
484472

485473
/**
486474
* Updates lock timeout information on this item.
@@ -491,7 +479,6 @@ public void unlock(String lockToken) throws PreconditionFailedException,
491479
* @throws PreconditionFailedException Included lock token was not enforceable on this item.
492480
* @throws ServerException In case of an error.
493481
*/
494-
// <<<< refreshLockImpl
495482
@Override
496483
public RefreshLockResult refreshLock(String token, long timeout)
497484
throws PreconditionFailedException, ServerException {
@@ -517,6 +504,5 @@ public RefreshLockResult refreshLock(String token, long timeout)
517504
return new RefreshLockResult(lockInfo.isShared(), lockInfo.isDeep(),
518505
timeout, lockInfo.getOwner());
519506
}
520-
// refreshLockImpl >>>>
521507

522508
}

Java/androidfsstorage/app/src/main/java/com/ithit/webdav/samples/androidfsstorage/WebDavEngine.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class WebDavEngine extends Engine {
3333
* @return Instance of corresponding {@link HierarchyItem} or null if item is not found.
3434
* @throws ServerException in case if cannot read file attributes.
3535
*/
36-
// <<<< getHierarchyItemEngine
3736
@Override
3837
public HierarchyItem getHierarchyItem(String contextPath) throws ServerException {
3938
int i = contextPath.indexOf("?");
@@ -52,7 +51,6 @@ public HierarchyItem getHierarchyItem(String contextPath) throws ServerException
5251
getLogger().logDebug("Could not find item that corresponds to path: " + contextPath);
5352
return null; // no hierarchy item that corresponds to path parameter was found in the repository
5453
}
55-
// getHierarchyItemEngine >>>>
5654

5755
/**
5856
* Returns logger that will be used by engine.

Java/deltav/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.ithit.webdav.samples</groupId>
88
<artifactId>deltav</artifactId>
9-
<version>4.7.4551</version>
9+
<version>4.7.4603</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.ithit.webdav.integration</groupId>
2525
<artifactId>servlet-integration</artifactId>
26-
<version>4.7.4551</version>
26+
<version>4.7.4603</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>commons-dbcp</groupId>
@@ -125,7 +125,7 @@
125125
<dependency>
126126
<groupId>com.ithit.webdav</groupId>
127127
<artifactId>webdav-server</artifactId>
128-
<version>4.7.4551</version>
128+
<version>4.7.4603</version>
129129
</dependency>
130130

131131
<dependency>
@@ -165,7 +165,7 @@
165165
<goal>copy-resources</goal>
166166
</goals>
167167
<configuration>
168-
<outputDirectory>${project.build.directory}/deltav-4.7.4551/META-INF</outputDirectory>
168+
<outputDirectory>${project.build.directory}/deltav-4.7.4603/META-INF</outputDirectory>
169169
<overwrite>true</overwrite>
170170
<resources>
171171
<resource>
@@ -244,7 +244,7 @@
244244
<server>filesystem</server>
245245
<port>11021</port>
246246
<path>/</path>
247-
<warSourceDirectory>target/deltav-4.7.4551</warSourceDirectory>
247+
<warSourceDirectory>target/deltav-4.7.4603</warSourceDirectory>
248248
</configuration>
249249
</plugin>
250250
<plugin>

Java/filesystemstorage/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.ithit.webdav.samples</groupId>
88
<artifactId>filesystemstorage</artifactId>
9-
<version>4.7.4551</version>
9+
<version>4.7.4603</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -34,7 +34,7 @@
3434
<dependency>
3535
<groupId>com.ithit.webdav.integration</groupId>
3636
<artifactId>servlet-integration</artifactId>
37-
<version>4.7.4551</version>
37+
<version>4.7.4603</version>
3838
</dependency>
3939
<dependency>
4040
<groupId>commons-io</groupId>
@@ -142,7 +142,7 @@
142142
<dependency>
143143
<groupId>com.ithit.webdav</groupId>
144144
<artifactId>webdav-server</artifactId>
145-
<version>4.7.4551</version>
145+
<version>4.7.4603</version>
146146
</dependency>
147147
<dependency>
148148
<groupId>net.java.dev.jna</groupId>
@@ -228,7 +228,7 @@
228228
<server>filesystem</server>
229229
<port>11021</port>
230230
<path>/</path>
231-
<warSourceDirectory>target/filesystemstorage-4.7.4551</warSourceDirectory>
231+
<warSourceDirectory>target/filesystemstorage-4.7.4603</warSourceDirectory>
232232
</configuration>
233233
</plugin>
234234
<plugin>

Java/filesystemstorage/src/main/java/com/ithit/webdav/samples/fsstorageservlet/FileImpl.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.ithit.webdav.server.exceptions.ServerException;
99
import com.ithit.webdav.server.resumableupload.ResumableUpload;
1010
import com.ithit.webdav.server.resumableupload.UploadProgress;
11-
import com.sun.nio.file.ExtendedOpenOption;
1211

1312
import java.io.IOException;
1413
import java.io.InputStream;
@@ -51,7 +50,20 @@ private FileImpl(String name, String path, long created, long modified, WebDavEn
5150
this.allowedOpenFileOptions = (systemName.contains("mac") || systemName.contains("linux")) ?
5251
(new OpenOption[]{StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.READ}) :
5352
(new OpenOption[]{StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.READ,
54-
ExtendedOpenOption.NOSHARE_DELETE});
53+
noShareDeleteOption()});
54+
}
55+
56+
/**
57+
* Load ExtendedOpenOption with reflection without direct reference - because most of Linux/MacOS jdks don't have it and not required.
58+
*/
59+
@SuppressWarnings({"rawtypes", "unchecked"})
60+
private OpenOption noShareDeleteOption() {
61+
try {
62+
Class enumClass = Class.forName("com.sun.nio.file.ExtendedOpenOption");
63+
return (OpenOption) Enum.valueOf(enumClass, "NOSHARE_DELETE");
64+
} catch (ClassNotFoundException e) {
65+
return StandardOpenOption.READ;
66+
}
5567
}
5668

5769
/**

0 commit comments

Comments
 (0)