Skip to content

Commit f094f32

Browse files
committed
4.0.2590-beta
1 parent f9da4c1 commit f094f32

File tree

18 files changed

+734
-128
lines changed

18 files changed

+734
-128
lines changed

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-3.2.2438.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
33+
'webdav-server-4.0.2590-beta.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:3.2.2438', {
74+
implementation('com.ithit.webdav.integration:android-integration:4.0.2590-beta', {
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:3.2.2438'
79+
jarJar 'com.ithit.webdav:webdav-server:4.0.2590-beta'
8080
testImplementation 'junit:junit:4.12'
8181
}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import com.ithit.webdav.server.exceptions.MultistatusException;
88
import com.ithit.webdav.server.exceptions.ServerException;
99
import com.ithit.webdav.server.exceptions.WebDavStatus;
10+
import com.ithit.webdav.server.paging.OrderProperty;
11+
import com.ithit.webdav.server.paging.PageResults;
1012
import com.ithit.webdav.server.quota.Quota;
1113

1214
import org.apache.commons.io.FileUtils;
@@ -123,12 +125,15 @@ public void createFolder(String name) throws LockedException,
123125
* Gets the array of this folder's children.
124126
*
125127
* @param propNames List of properties to retrieve with the children. They will be queried by the engine later.
126-
* @return Array of {@link HierarchyItemImpl} objects. Each item is a {@link FileImpl} or {@link FolderImpl} item.
128+
* @param offset The number of items to skip before returning the remaining items.
129+
* @param nResults The number of items to return.
130+
* @param orderProps List of order properties requested by the client.
131+
* @return Instance of {@link PageResults} class that contains items on a requested page and total number of items in a folder.
127132
* @throws ServerException In case of an error.
128133
*/
129134
// <<<< getChildren
130135
@Override
131-
public List<? extends HierarchyItemImpl> getChildren(List<Property> propNames) throws ServerException {
136+
public PageResults getChildren(List<Property> propNames, Long offset, Long nResults, List<OrderProperty> orderProps) throws ServerException {
132137
String decodedPath = HierarchyItemImpl.decodeAndConvertToPath(getPath());
133138
File fullFolderPath = FileUtils.getFile(getRootFolder() + decodedPath);
134139
List<HierarchyItemImpl> children = new ArrayList<>();
@@ -139,9 +144,9 @@ public List<? extends HierarchyItemImpl> getChildren(List<Property> propNames) t
139144
children.add(item);
140145
}
141146
} catch (Exception ex) {
142-
return children;
147+
return new PageResults(children, null);
143148
}
144-
return children;
149+
return new PageResults(children, null);
145150
}
146151
// getChildren >>>>
147152

androidfsstorage/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
google()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.1.2'
10+
classpath 'com.android.tools.build:gradle:3.2.0'
1111
classpath 'ru.tinkoff.gradle:jarjar:1.1.0'
1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Apr 25 13:57:18 EEST 2018
1+
#Sun Oct 07 09:09:04 EEST 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

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>3.2.2438</version>
9+
<version>4.0.2590-beta</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>3.2.2438</version>
26+
<version>4.0.2590-beta</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>commons-dbcp</groupId>
@@ -93,7 +93,7 @@
9393
<dependency>
9494
<groupId>com.ithit.webdav</groupId>
9595
<artifactId>webdav-server</artifactId>
96-
<version>3.2.2438</version>
96+
<version>4.0.2590-beta</version>
9797
</dependency>
9898

9999
<dependency>
@@ -133,7 +133,7 @@
133133
<goal>copy-resources</goal>
134134
</goals>
135135
<configuration>
136-
<outputDirectory>${project.build.directory}/deltav-3.2.2438/META-INF</outputDirectory>
136+
<outputDirectory>${project.build.directory}/deltav-4.0.2590-beta/META-INF</outputDirectory>
137137
<overwrite>true</overwrite>
138138
<resources>
139139
<resource>
@@ -212,7 +212,7 @@
212212
<server>filesystem</server>
213213
<port>11021</port>
214214
<path>/</path>
215-
<warSourceDirectory>target/deltav-3.2.2438</warSourceDirectory>
215+
<warSourceDirectory>target/deltav-4.0.2590-beta</warSourceDirectory>
216216
</configuration>
217217
</plugin>
218218
<plugin>

deltav/src/main/java/com/ithit/webdav/samples/deltavservlet/FolderImpl.java

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.ithit.webdav.server.*;
44
import com.ithit.webdav.server.exceptions.*;
5+
import com.ithit.webdav.server.paging.OrderProperty;
6+
import com.ithit.webdav.server.paging.PageResults;
57
import com.ithit.webdav.server.quota.Quota;
68
import com.ithit.webdav.server.search.Search;
79
import com.ithit.webdav.server.search.SearchOptions;
@@ -35,11 +37,14 @@ public class FolderImpl extends HierarchyItemImpl implements Folder, Search, Quo
3537
* Gets the array of this folder's children.
3638
*
3739
* @param propNames List of properties to retrieve with the children. They will be queried by the engine later.
38-
* @return Array of {@link HierarchyItemImpl} objects. Each item is a {@link FileImpl} or {@link FolderImpl} item.
40+
* @param offset The number of items to skip before returning the remaining items.
41+
* @param nResults The number of items to return.
42+
* @param orderProps List of order properties requested by the client.
43+
* @return Instance of {@link PageResults} class that contains items on a requested page and total number of items in a folder.
3944
* @throws ServerException In case of an error.
4045
*/
41-
public List<HierarchyItemImpl> getChildren(List<Property> propNames) throws ServerException {
42-
return getDataAccess().readItems(
46+
public PageResults getChildren(List<Property> propNames, Long offset, Long nResults, List<OrderProperty> orderProps) throws ServerException {
47+
return new PageResults(getDataAccess().readItems(
4348
"SELECT ID," +
4449
" Parent," +
4550
" ItemType," +
@@ -54,7 +59,7 @@ public List<HierarchyItemImpl> getChildren(List<Property> propNames) throws Serv
5459
" AutoVersion," +
5560
" CheckinOnFileComplete"
5661
+ " FROM Repository"
57-
+ " WHERE Parent = ? AND ID != 0", getPath(), true, id);
62+
+ " WHERE Parent = ? AND ID != 0", getPath(), true, id), null);
5863
}
5964

6065
/**
@@ -217,7 +222,7 @@ public void moveTo(Folder folder, String destName)
217222
}
218223
// move children
219224
MultistatusException mr = new MultistatusException();
220-
for (HierarchyItem child : getChildren(Collections.<Property>emptyList())) {
225+
for (HierarchyItem child : getChildren(Collections.<Property>emptyList(), null, null, null).getPage()) {
221226
try {
222227
child.moveTo(newDestFolder, child.getName());
223228
} catch (MultistatusException e) {
@@ -274,7 +279,7 @@ public void copyTo(Folder folder, String destName, boolean deep)
274279
// copy children
275280
MultistatusException mr = new MultistatusException();
276281
if (deep) {
277-
for (HierarchyItemImpl child : getChildren(Collections.<Property>emptyList())) {
282+
for (HierarchyItem child : getChildren(Collections.<Property>emptyList(), null, null, null).getPage()) {
278283
try {
279284
child.copyTo(newDestFolder, child.getName(), deep);
280285
} catch (MultistatusException ex) {
@@ -310,7 +315,7 @@ public void delete() throws ServerException, LockedException, MultistatusExcepti
310315

311316
MultistatusException mx = new MultistatusException();
312317

313-
for (HierarchyItem child : getChildren(Collections.<Property>emptyList())) {
318+
for (HierarchyItem child : getChildren(Collections.<Property>emptyList(), null, null, null).getPage()) {
314319
try {
315320
child.delete();
316321
} catch (MultistatusException ex) {
@@ -336,12 +341,12 @@ public void delete() throws ServerException, LockedException, MultistatusExcepti
336341
* @throws ServerException in case of DB errors.
337342
*/
338343
void removeTree() throws ServerException {
339-
for (HierarchyItemImpl child : getChildren(Collections.<Property>emptyList())) {
344+
for (HierarchyItem child : getChildren(Collections.<Property>emptyList(), null, null, null).getPage()) {
340345
FolderImpl childFolder = child instanceof FolderImpl ? (FolderImpl) child : null;
341346
if (childFolder != null)
342347
childFolder.removeTree();
343348
else
344-
child.deleteThisItem();
349+
((HierarchyItemImpl)child).deleteThisItem();
345350
}
346351
deleteThisItem();
347352
}
@@ -355,13 +360,13 @@ private boolean clientHasTokenForTree() throws ServerException {
355360

356361
if (!clientHasToken())
357362
return false;
358-
for (HierarchyItemImpl child : getChildren(Collections.<Property>emptyList())) {
363+
for (HierarchyItem child : getChildren(Collections.<Property>emptyList(), null, null, null).getPage()) {
359364
FolderImpl childFolder = child instanceof FolderImpl ? (FolderImpl) child : null;
360365
if (childFolder != null) {
361366
if (!childFolder.clientHasTokenForTree())
362367
return false;
363368
} else {
364-
if (!child.clientHasToken())
369+
if (!((HierarchyItemImpl)child).clientHasToken())
365370
return false;
366371
}
367372
}
@@ -390,14 +395,16 @@ protected HierarchyItemImpl createItemCopy(int id, int parentId, String name, St
390395
* @param searchString A phrase to search.
391396
* @param options Search parameters.
392397
* @param propNames List of properties to retrieve with the children. They will be queried by the engine later.
393-
* @return ist of {@link HierarchyItem} satisfying the search parameters or empty list.
398+
* @param offset The number of items to skip before returning the remaining items.
399+
* @param nResults The number of items to return.
400+
* @return Instance of {@link PageResults} class that contains items on a requested page and total number of items in search results.
394401
*/
395402
@Override
396-
public List<HierarchyItem> search(String searchString, SearchOptions options, List<Property> propNames) {
403+
public PageResults search(String searchString, SearchOptions options, List<Property> propNames, Long offset, Long nResults) {
397404
List<HierarchyItem> results = new LinkedList<>();
398405
SearchFacade.Searcher searcher = getEngine().getSearchFacade().getSearcher();
399406
if (searcher == null) {
400-
return results;
407+
return new PageResults(results, null);
401408
}
402409
boolean snippet = false;
403410
for (Property pr : propNames) {
@@ -440,7 +447,7 @@ public List<HierarchyItem> search(String searchString, SearchOptions options, Li
440447
getEngine().getLogger().logError("Error during search.", ex);
441448
}
442449
}
443-
return results;
450+
return new PageResults(results, null);
444451
}
445452

446453
/**

deltav/src/main/java/com/ithit/webdav/samples/deltavservlet/HierarchyItemImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,10 @@ private void checkNoItemsLocked(MultistatusException mr, HierarchyItemImpl root,
498498

499499
FolderImpl folder = root instanceof FolderImpl ? (FolderImpl) root : null;
500500
if (folder != null)
501-
for (HierarchyItemImpl child : folder.getChildren(Collections.<Property>emptyList())) {
502-
if (child.itemHasLock(skipShared))
501+
for (HierarchyItem child : folder.getChildren(Collections.<Property>emptyList(), null, null, null).getPage()) {
502+
if (((HierarchyItemImpl)child).itemHasLock(skipShared))
503503
mr.addResponse(child.getPath(), WebDavStatus.LOCKED);
504-
checkNoItemsLocked(mr, child, skipShared);
504+
checkNoItemsLocked(mr, ((HierarchyItemImpl)child), skipShared);
505505
}
506506

507507
}

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>3.2.2438</version>
9+
<version>4.0.2590-beta</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -36,7 +36,7 @@
3636
<dependency>
3737
<groupId>com.ithit.webdav.integration</groupId>
3838
<artifactId>servlet-integration</artifactId>
39-
<version>3.2.2438</version>
39+
<version>4.0.2590-beta</version>
4040
</dependency>
4141
<dependency>
4242
<groupId>commons-io</groupId>
@@ -112,7 +112,7 @@
112112
<dependency>
113113
<groupId>com.ithit.webdav</groupId>
114114
<artifactId>webdav-server</artifactId>
115-
<version>3.2.2438</version>
115+
<version>4.0.2590-beta</version>
116116
</dependency>
117117
<dependency>
118118
<groupId>net.java.dev.jna</groupId>
@@ -198,7 +198,7 @@
198198
<server>filesystem</server>
199199
<port>11021</port>
200200
<path>/</path>
201-
<warSourceDirectory>target/filesystemstorage-3.2.2438</warSourceDirectory>
201+
<warSourceDirectory>target/filesystemstorage-4.0.2590-beta</warSourceDirectory>
202202
</configuration>
203203
</plugin>
204204
<plugin>

0 commit comments

Comments
 (0)