Skip to content

Commit 2b64aaf

Browse files
committed
7.3.10843
1 parent 0eae0bf commit 2b64aaf

File tree

37 files changed

+186
-190
lines changed

37 files changed

+186
-190
lines changed

Java/android/androidfsstorage/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434
jarJar {
3535
rules = [
3636
'stax-api-1.0.1.jar' : 'javax.xml.** com.ithit.webdav.xml.@1',
37-
'webdav-server-7.3.10725.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
37+
'webdav-server-7.3.10843.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
3838
]
3939
}
4040

@@ -75,11 +75,11 @@ dependencies {
7575
implementation 'commons-io:commons-io:2.7'
7676
implementation 'com.google.code.gson:gson:2.8.9'
7777
implementation 'com.android.support:appcompat-v7:27.1.1'
78-
implementation('com.ithit.webdav.integration:android-integration:7.3.10725', {
78+
implementation('com.ithit.webdav.integration:android-integration:7.3.10843', {
7979
exclude group: 'org.nanohttpd', module: 'nanohttpd'
8080
})
8181
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
8282
jarJar 'stax:stax-api:1.0.1'
83-
jarJar 'com.ithit.webdav:webdav-server:7.3.10725'
83+
jarJar 'com.ithit.webdav:webdav-server:7.3.10843'
8484
testImplementation 'junit:junit:4.12'
8585
}

Java/jakarta/collectionsync/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>collectionsync-jakarta</artifactId>
9-
<version>7.3.10725</version>
9+
<version>7.3.10843</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -25,7 +25,7 @@
2525
<dependency>
2626
<groupId>com.ithit.webdav.integration</groupId>
2727
<artifactId>jakarta-integration</artifactId>
28-
<version>7.3.10725</version>
28+
<version>7.3.10843</version>
2929
</dependency>
3030
<dependency>
3131
<groupId>commons-lang</groupId>
@@ -60,7 +60,7 @@
6060
<dependency>
6161
<groupId>com.ithit.webdav</groupId>
6262
<artifactId>webdav-server</artifactId>
63-
<version>7.3.10725</version>
63+
<version>7.3.10843</version>
6464
</dependency>
6565
</dependencies>
6666

@@ -132,7 +132,7 @@
132132
<server>filesystem</server>
133133
<port>11021</port>
134134
<path>/</path>
135-
<warSourceDirectory>target/collectionsync-jakarta-7.3.10725</warSourceDirectory>
135+
<warSourceDirectory>target/collectionsync-jakarta-7.3.10843</warSourceDirectory>
136136
</configuration>
137137
</plugin>
138138
<plugin>

Java/jakarta/collectionsync/src/main/java/com/ithit/webdav/samples/collectionsync/FileImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ final class FileImpl extends HierarchyItemImpl implements File, Lock,
4141
* @param name Name of hierarchy item.
4242
* @param path Relative to WebDAV root folder path.
4343
* @param created Creation time of the hierarchy item.
44-
* @param modified Modification time of the hierarchy item.
4544
* @param engine Instance of current {@link WebDavEngine}.
4645
*/
47-
private FileImpl(String name, String path, long created, long modified, WebDavEngine engine) {
48-
super(name, path, created, modified, engine);
46+
private FileImpl(String name, String path, long created, WebDavEngine engine) {
47+
super(name, path, created, engine);
4948

5049
/* Mac OS X and Ubuntu doesn't work with ExtendedOpenOption.NOSHARE_DELETE */
5150
String systemName = System.getProperty("os.name").toLowerCase();
@@ -93,8 +92,7 @@ static FileImpl getFile(String path, WebDavEngine engine) throws ServerException
9392
throw new ServerException();
9493
}
9594
long created = view.creationTime().toMillis();
96-
long modified = view.lastModifiedTime().toMillis();
97-
final FileImpl file = new FileImpl(name, itemMapping.davPath, created, modified, engine);
95+
final FileImpl file = new FileImpl(name, itemMapping.davPath, created, engine);
9896
file.setTotalContentLength(file.readTotalContentLength());
9997
return file;
10098
}

Java/jakarta/collectionsync/src/main/java/com/ithit/webdav/samples/collectionsync/FolderImpl.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ final class FolderImpl extends HierarchyItemImpl implements Folder, Search, Quot
4343
* @param name Name of hierarchy item.
4444
* @param path Relative to WebDAV root folder path.
4545
* @param created Creation time of the hierarchy item.
46-
* @param modified Modification time of the hierarchy item.
4746
* @param engine Instance of current {@link WebDavEngine}
4847
*/
49-
private FolderImpl(String name, String path, long created, long modified,
50-
WebDavEngine engine) {
51-
super(name, path, created, modified, engine);
48+
private FolderImpl(String name, String path, long created, WebDavEngine engine) {
49+
super(name, path, created, engine);
5250
}
5351

5452
/**
@@ -78,8 +76,7 @@ static FolderImpl getFolder(String path, WebDavEngine engine) throws ServerExcep
7876
}
7977

8078
long created = view.creationTime().toMillis();
81-
long modified = view.lastModifiedTime().toMillis();
82-
return new FolderImpl(name, fixPath(itemMapping.davPath), created, modified, engine);
79+
return new FolderImpl(name, fixPath(itemMapping.davPath), created, engine);
8380
}
8481

8582
private static String fixPath(String path) {

Java/jakarta/collectionsync/src/main/java/com/ithit/webdav/samples/collectionsync/HierarchyItemImpl.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.net.URLDecoder;
1818
import java.net.URLEncoder;
1919
import java.nio.file.Files;
20+
import java.nio.file.LinkOption;
2021
import java.nio.file.Path;
2122
import java.nio.file.Paths;
2223
import java.nio.file.attribute.BasicFileAttributeView;
@@ -40,7 +41,6 @@ abstract class HierarchyItemImpl implements HierarchyItem, Lock, ChangedItem, Bi
4041
private static final String SERVER_ROOT_CONTEXT = "ServerRoot/";
4142
private final String path;
4243
private final long created;
43-
private final long modified;
4444
private final WebDavEngine engine;
4545
private String name;
4646
String activeLocksAttribute = "Locks";
@@ -54,14 +54,12 @@ abstract class HierarchyItemImpl implements HierarchyItem, Lock, ChangedItem, Bi
5454
* @param name name of hierarchy item
5555
* @param path Relative to WebDAV root folder path.
5656
* @param created creation time of the hierarchy item
57-
* @param modified modification time of the hierarchy item
5857
* @param engine instance of current {@link WebDavEngine}
5958
*/
60-
HierarchyItemImpl(String name, String path, long created, long modified, WebDavEngine engine) {
59+
HierarchyItemImpl(String name, String path, long created, WebDavEngine engine) {
6160
this.name = name;
6261
this.path = path;
6362
this.created = created;
64-
this.modified = modified;
6563
this.engine = engine;
6664
}
6765

@@ -173,7 +171,11 @@ public long getCreated() throws ServerException {
173171
*/
174172
@Override
175173
public long getModified() throws ServerException {
176-
return modified;
174+
try {
175+
return Files.getLastModifiedTime(getFullPath(), LinkOption.NOFOLLOW_LINKS).toMillis();
176+
} catch (IOException e) {
177+
throw new ServerException(e);
178+
}
177179
}
178180

179181
/**
@@ -520,15 +522,16 @@ public List<LockInfo> getActiveLocks() throws ServerException {
520522
String activeLocksJson = ExtendedAttributesExtension.getExtendedAttribute(getFullPath().toString(), activeLocksAttribute);
521523
activeLocks = new ArrayList<>(SerializationUtils.deserializeList(LockInfo.class, activeLocksJson));
522524
} else {
523-
activeLocks = new LinkedList<>();
525+
activeLocks = new ArrayList<>();
524526
}
527+
final long currentTime = System.currentTimeMillis();
525528
return activeLocks.stream()
526-
.filter(x -> System.currentTimeMillis() < x.getTimeout())
529+
.filter(x -> currentTime < x.getTimeout())
527530
.map(lock -> new LockInfo(
528531
lock.isShared(),
529532
lock.isDeep(),
530533
lock.getToken(),
531-
(lock.getTimeout() < 0 || lock.getTimeout() == Long.MAX_VALUE) ? lock.getTimeout() : (lock.getTimeout() - System.currentTimeMillis()) / 1000,
534+
(lock.getTimeout() < 0 || lock.getTimeout() == Long.MAX_VALUE) ? lock.getTimeout() : (lock.getTimeout() - currentTime) / 1000,
532535
lock.getOwner()))
533536
.collect(Collectors.toList());
534537
}

Java/jakarta/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>7.3.10725</version>
9+
<version>7.3.10843</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -25,7 +25,7 @@
2525
<dependency>
2626
<groupId>com.ithit.webdav.integration</groupId>
2727
<artifactId>jakarta-integration</artifactId>
28-
<version>7.3.10725</version>
28+
<version>7.3.10843</version>
2929
</dependency>
3030
<dependency>
3131
<groupId>commons-io</groupId>
@@ -66,7 +66,7 @@
6666
<dependency>
6767
<groupId>com.ithit.webdav</groupId>
6868
<artifactId>webdav-server</artifactId>
69-
<version>7.3.10725</version>
69+
<version>7.3.10843</version>
7070
</dependency>
7171
</dependencies>
7272

@@ -138,7 +138,7 @@
138138
<server>filesystem</server>
139139
<port>11021</port>
140140
<path>/</path>
141-
<warSourceDirectory>target/filesystemstorage-jakarta-7.3.10725</warSourceDirectory>
141+
<warSourceDirectory>target/filesystemstorage-jakarta-7.3.10843</warSourceDirectory>
142142
</configuration>
143143
</plugin>
144144
<plugin>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ final class FileImpl extends HierarchyItemImpl implements File, Lock,
4040
* @param name Name of hierarchy item.
4141
* @param path Relative to WebDAV root folder path.
4242
* @param created Creation time of the hierarchy item.
43-
* @param modified Modification time of the hierarchy item.
4443
* @param engine Instance of current {@link WebDavEngine}.
4544
*/
46-
private FileImpl(String name, String path, long created, long modified, WebDavEngine engine) {
47-
super(name, path, created, modified, engine);
45+
private FileImpl(String name, String path, long created, WebDavEngine engine) {
46+
super(name, path, created, engine);
4847

4948
/* Mac OS X and Ubuntu doesn't work with ExtendedOpenOption.NOSHARE_DELETE */
5049
String systemName = System.getProperty("os.name").toLowerCase();
@@ -94,8 +93,7 @@ static FileImpl getFile(String path, WebDavEngine engine) throws ServerException
9493
throw new ServerException();
9594
}
9695
long created = view.creationTime().toMillis();
97-
long modified = view.lastModifiedTime().toMillis();
98-
return new FileImpl(name, path, created, modified, engine);
96+
return new FileImpl(name, path, created, engine);
9997
}
10098

10199
/**

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ final class FolderImpl extends HierarchyItemImpl implements Folder, Search, Quot
3434
* @param name Name of hierarchy item.
3535
* @param path Relative to WebDAV root folder path.
3636
* @param created Creation time of the hierarchy item.
37-
* @param modified Modification time of the hierarchy item.
3837
* @param engine Instance of current {@link WebDavEngine}
3938
*/
40-
private FolderImpl(String name, String path, long created, long modified,
39+
private FolderImpl(String name, String path, long created,
4140
WebDavEngine engine) {
42-
super(name, path, created, modified, engine);
41+
super(name, path, created, engine);
4342
}
4443

4544
/**
@@ -71,8 +70,7 @@ static FolderImpl getFolder(String path, WebDavEngine engine) throws ServerExcep
7170
}
7271

7372
long created = view.creationTime().toMillis();
74-
long modified = view.lastModifiedTime().toMillis();
75-
return new FolderImpl(name, fixPath(path), created, modified, engine);
73+
return new FolderImpl(name, fixPath(path), created, engine);
7674
}
7775

7876
private static String fixPath(String path) {

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
import com.ithit.webdav.server.exceptions.*;
99

1010
import java.io.File;
11+
import java.io.IOException;
1112
import java.io.UnsupportedEncodingException;
1213
import java.net.URLDecoder;
1314
import java.net.URLEncoder;
1415
import java.nio.file.Files;
16+
import java.nio.file.LinkOption;
1517
import java.nio.file.Path;
1618
import java.nio.file.Paths;
1719
import java.nio.file.attribute.BasicFileAttributeView;
@@ -31,7 +33,6 @@ abstract class HierarchyItemImpl implements HierarchyItem, Lock {
3133
private static final String METADATA_ETAG = "metadata-Etag";
3234
private final String path;
3335
private final long created;
34-
private final long modified;
3536
private final WebDavEngine engine;
3637
private String name;
3738
String activeLocksAttribute = "Locks";
@@ -45,14 +46,12 @@ abstract class HierarchyItemImpl implements HierarchyItem, Lock {
4546
* @param name name of hierarchy item
4647
* @param path Relative to WebDAV root folder path.
4748
* @param created creation time of the hierarchy item
48-
* @param modified modification time of the hierarchy item
4949
* @param engine instance of current {@link WebDavEngine}
5050
*/
51-
HierarchyItemImpl(String name, String path, long created, long modified, WebDavEngine engine) {
51+
HierarchyItemImpl(String name, String path, long created, WebDavEngine engine) {
5252
this.name = name;
5353
this.path = path;
5454
this.created = created;
55-
this.modified = modified;
5655
this.engine = engine;
5756
}
5857

@@ -164,7 +163,11 @@ public long getCreated() throws ServerException {
164163
*/
165164
@Override
166165
public long getModified() throws ServerException {
167-
return modified;
166+
try {
167+
return Files.getLastModifiedTime(getFullPath(), LinkOption.NOFOLLOW_LINKS).toMillis();
168+
} catch (IOException e) {
169+
throw new ServerException(e);
170+
}
168171
}
169172

170173
/**
@@ -487,15 +490,16 @@ public List<LockInfo> getActiveLocks() throws ServerException {
487490
String activeLocksJson = ExtendedAttributesExtension.getExtendedAttribute(getFullPath().toString(), activeLocksAttribute);
488491
activeLocks = new ArrayList<>(SerializationUtils.deserializeList(LockInfo.class, activeLocksJson));
489492
} else {
490-
activeLocks = new LinkedList<>();
493+
activeLocks = new ArrayList<>();
491494
}
495+
final long currentTime = System.currentTimeMillis();
492496
return activeLocks.stream()
493-
.filter(x -> System.currentTimeMillis() < x.getTimeout())
497+
.filter(x -> currentTime < x.getTimeout())
494498
.map(lock -> new LockInfo(
495499
lock.isShared(),
496500
lock.isDeep(),
497501
lock.getToken(),
498-
(lock.getTimeout() < 0 || lock.getTimeout() == Long.MAX_VALUE) ? lock.getTimeout() : (lock.getTimeout() - System.currentTimeMillis()) / 1000,
502+
(lock.getTimeout() < 0 || lock.getTimeout() == Long.MAX_VALUE) ? lock.getTimeout() : (lock.getTimeout() - currentTime) / 1000,
499503
lock.getOwner()))
500504
.collect(Collectors.toList());
501505
}

Java/jakarta/oraclestorage/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>oraclestorage</artifactId>
9-
<version>7.3.10725</version>
9+
<version>7.3.10843</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>com.ithit.webdav.integration</groupId>
1919
<artifactId>jakarta-integration</artifactId>
20-
<version>7.3.10725</version>
20+
<version>7.3.10843</version>
2121
</dependency>
2222
<dependency>
2323
<groupId>commons-dbcp</groupId>
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>com.ithit.webdav</groupId>
6767
<artifactId>webdav-server</artifactId>
68-
<version>7.3.10725</version>
68+
<version>7.3.10843</version>
6969
</dependency>
7070
</dependencies>
7171

@@ -90,7 +90,7 @@
9090
<goal>copy-resources</goal>
9191
</goals>
9292
<configuration>
93-
<outputDirectory>${project.build.directory}/oraclestorage-jakarta-7.3.10725/META-INF</outputDirectory>
93+
<outputDirectory>${project.build.directory}/oraclestorage-jakarta-7.3.10843/META-INF</outputDirectory>
9494
<overwrite>true</overwrite>
9595
<resources>
9696
<resource>
@@ -169,7 +169,7 @@
169169
<server>filesystem</server>
170170
<port>11021</port>
171171
<path>/</path>
172-
<warSourceDirectory>target/oraclestorage-jakarta-7.3.10725</warSourceDirectory>
172+
<warSourceDirectory>target/oraclestorage-jakarta-7.3.10843</warSourceDirectory>
173173
</configuration>
174174
</plugin>
175175
<plugin>

0 commit comments

Comments
 (0)