Skip to content

Commit 210af22

Browse files
committed
3.2.2435
1 parent 7c8325e commit 210af22

File tree

24 files changed

+3243
-3233
lines changed

24 files changed

+3243
-3233
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.sql linguist-language=Java
1+
*.sql linguist-language=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-3.2.2431.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
33+
'webdav-server-3.2.2435.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.2431', {
74+
implementation('com.ithit.webdav.integration:android-integration:3.2.2435', {
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.2431'
79+
jarJar 'com.ithit.webdav:webdav-server:3.2.2435'
8080
testImplementation 'junit:junit:4.12'
8181
}

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.2431</version>
9+
<version>3.2.2435</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.2431</version>
26+
<version>3.2.2435</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.2431</version>
96+
<version>3.2.2435</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.2431/META-INF</outputDirectory>
136+
<outputDirectory>${project.build.directory}/deltav-3.2.2435/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.2431</warSourceDirectory>
215+
<warSourceDirectory>target/deltav-3.2.2435</warSourceDirectory>
216216
</configuration>
217217
</plugin>
218218
<plugin>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ int genVersionId() throws ServerException {
728728
*/
729729
void moveThisItem(FolderImpl destFolder, String destName, FolderImpl parent) throws ServerException {
730730

731-
// getDataAccess().executeUpdate("DELETE FROM Locks WHERE ItemID = ?", getId());
731+
getDataAccess().executeUpdate("DELETE FROM Locks WHERE ItemID = ?", getId());
732732
getDataAccess().executeUpdate("UPDATE Repository SET"
733733
+ " Name = ?"
734734
+ ", Parent = ?"

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.2431</version>
9+
<version>3.2.2435</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.2431</version>
39+
<version>3.2.2435</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.2431</version>
115+
<version>3.2.2435</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.2431</warSourceDirectory>
201+
<warSourceDirectory>target/filesystemstorage-3.2.2435</warSourceDirectory>
202202
</configuration>
203203
</plugin>
204204
<plugin>
Lines changed: 115 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
1-
package com.ithit.webdav.samples.fsstorageservlet;
2-
3-
import com.ithit.webdav.server.Folder;
4-
import com.ithit.webdav.server.HierarchyItem;
5-
import com.ithit.webdav.server.MethodHandler;
6-
import com.ithit.webdav.server.exceptions.DavException;
7-
import com.ithit.webdav.server.http.DavRequest;
8-
import com.ithit.webdav.server.http.DavResponse;
9-
import org.apache.commons.io.FileUtils;
10-
11-
import java.io.IOException;
12-
import java.io.PrintStream;
13-
import java.nio.charset.Charset;
14-
import java.nio.charset.StandardCharsets;
15-
import java.nio.file.Files;
16-
import java.nio.file.Path;
17-
import java.nio.file.Paths;
18-
19-
/**
20-
* This handler processes GET requests to folders returning custom HTML page.
21-
*/
22-
public class CustomFolderGetHandler implements MethodHandler {
23-
24-
private MethodHandler previousHandler;
25-
private String charset;
26-
private String version;
27-
private String pathToHTML = "WEB-INF/MyCustomHandlerPage.html";
28-
private String pathToErrorHTML = "WEB-INF/attributesErrorPage.html";
29-
30-
public CustomFolderGetHandler(String charset, String version) {
31-
this.charset = charset;
32-
this.version = version;
33-
}
34-
35-
@Override
36-
public void processRequest(DavRequest request, DavResponse response, HierarchyItem item)
37-
throws DavException, IOException {
38-
if (item instanceof Folder) {
39-
PrintStream stream = new PrintStream(response.getOutputStream(), true, charset);
40-
response.setCharacterEncoding(charset);
41-
response.setContentType("text/html");
42-
if (!WebDavServlet.isSupportsUserDefinedAttributes()) {
43-
Path path = Paths.get(WebDavServlet.getRealPath(), pathToErrorHTML);
44-
String lines = FileUtils.readFileToString(path.toFile(), Charset.defaultCharset());
45-
stream.println(lines);
46-
} else {
47-
Path path = Paths.get(WebDavServlet.getRealPath(), pathToHTML);
48-
String context = WebDavServlet.getContext() + "/";
49-
String wsContext = context.replaceFirst("/", "");
50-
int ind = wsContext.lastIndexOf("/");
51-
if (ind >= 0) {
52-
wsContext = new StringBuilder(wsContext).replace(ind, ind + 1, "\\/").toString();
53-
}
54-
for (String line : Files.readAllLines(path, StandardCharsets.UTF_8)) {
55-
String contextRootString = "<%context root%>";
56-
if (line.contains(contextRootString)) {
57-
line = line.replace(contextRootString, context);
58-
}
59-
String versionNumber = "<%version%>";
60-
if (line.contains(versionNumber)) {
61-
line = line.replace(versionNumber, version);
62-
}
63-
String ws = "<%ws root%>";
64-
if (line.contains(ws)) {
65-
line = line.replace(ws, wsContext);
66-
}
67-
String version = "<%startTime%>";
68-
if (line.contains(version)) {
69-
line = line.replace(version, WebDavServlet.START_TIME);
70-
}
71-
stream.println(line);
72-
}
73-
}
74-
stream.flush();
75-
} else {
76-
previousHandler.processRequest(request, response, item);
77-
}
78-
}
79-
80-
/**
81-
* Determines whether request body shall be logged.
82-
*
83-
* @return {@code true} if request body shall be logged.
84-
*/
85-
public boolean getLogInput() {
86-
return false;
87-
}
88-
89-
/**
90-
* Determines whether response body shall be logged.
91-
*
92-
* @return {@code true} if response body shall be logged.
93-
*/
94-
public boolean getLogOutput() {
95-
return false;
96-
}
97-
98-
/**
99-
* Determines whether response content length shall be calculated by engine.
100-
*
101-
* @return {@code true} if content length shall be calculated by engine.
102-
*/
103-
public boolean getCalculateContentLength() {
104-
return false;
105-
}
106-
107-
/**
108-
* Set previous handler fo GET operation.
109-
*
110-
* @param methodHandler previous handler.
111-
*/
112-
void setPreviousHandler(MethodHandler methodHandler) {
113-
previousHandler = methodHandler;
114-
}
115-
}
1+
package com.ithit.webdav.samples.fsstorageservlet;
2+
3+
import com.ithit.webdav.server.Folder;
4+
import com.ithit.webdav.server.HierarchyItem;
5+
import com.ithit.webdav.server.MethodHandler;
6+
import com.ithit.webdav.server.exceptions.DavException;
7+
import com.ithit.webdav.server.http.DavRequest;
8+
import com.ithit.webdav.server.http.DavResponse;
9+
import org.apache.commons.io.FileUtils;
10+
11+
import java.io.IOException;
12+
import java.io.PrintStream;
13+
import java.nio.charset.Charset;
14+
import java.nio.charset.StandardCharsets;
15+
import java.nio.file.Files;
16+
import java.nio.file.Path;
17+
import java.nio.file.Paths;
18+
19+
/**
20+
* This handler processes GET requests to folders returning custom HTML page.
21+
*/
22+
public class CustomFolderGetHandler implements MethodHandler {
23+
24+
private MethodHandler previousHandler;
25+
private String charset;
26+
private String version;
27+
private String pathToHTML = "WEB-INF/MyCustomHandlerPage.html";
28+
private String pathToErrorHTML = "WEB-INF/attributesErrorPage.html";
29+
30+
public CustomFolderGetHandler(String charset, String version) {
31+
this.charset = charset;
32+
this.version = version;
33+
}
34+
35+
@Override
36+
public void processRequest(DavRequest request, DavResponse response, HierarchyItem item)
37+
throws DavException, IOException {
38+
if (item instanceof Folder) {
39+
PrintStream stream = new PrintStream(response.getOutputStream(), true, charset);
40+
response.setCharacterEncoding(charset);
41+
response.setContentType("text/html");
42+
if (!WebDavServlet.isSupportsUserDefinedAttributes()) {
43+
Path path = Paths.get(WebDavServlet.getRealPath(), pathToErrorHTML);
44+
String lines = FileUtils.readFileToString(path.toFile(), Charset.defaultCharset());
45+
stream.println(lines);
46+
} else {
47+
Path path = Paths.get(WebDavServlet.getRealPath(), pathToHTML);
48+
String context = WebDavServlet.getContext() + "/";
49+
String wsContext = context.replaceFirst("/", "");
50+
int ind = wsContext.lastIndexOf("/");
51+
if (ind >= 0) {
52+
wsContext = new StringBuilder(wsContext).replace(ind, ind + 1, "\\/").toString();
53+
}
54+
for (String line : Files.readAllLines(path, StandardCharsets.UTF_8)) {
55+
String contextRootString = "<%context root%>";
56+
if (line.contains(contextRootString)) {
57+
line = line.replace(contextRootString, context);
58+
}
59+
String versionNumber = "<%version%>";
60+
if (line.contains(versionNumber)) {
61+
line = line.replace(versionNumber, version);
62+
}
63+
String ws = "<%ws root%>";
64+
if (line.contains(ws)) {
65+
line = line.replace(ws, wsContext);
66+
}
67+
String version = "<%startTime%>";
68+
if (line.contains(version)) {
69+
line = line.replace(version, WebDavServlet.START_TIME);
70+
}
71+
stream.println(line);
72+
}
73+
}
74+
stream.flush();
75+
} else {
76+
previousHandler.processRequest(request, response, item);
77+
}
78+
}
79+
80+
/**
81+
* Determines whether request body shall be logged.
82+
*
83+
* @return {@code true} if request body shall be logged.
84+
*/
85+
public boolean getLogInput() {
86+
return false;
87+
}
88+
89+
/**
90+
* Determines whether response body shall be logged.
91+
*
92+
* @return {@code true} if response body shall be logged.
93+
*/
94+
public boolean getLogOutput() {
95+
return false;
96+
}
97+
98+
/**
99+
* Determines whether response content length shall be calculated by engine.
100+
*
101+
* @return {@code true} if content length shall be calculated by engine.
102+
*/
103+
public boolean getCalculateContentLength() {
104+
return false;
105+
}
106+
107+
/**
108+
* Set previous handler fo GET operation.
109+
*
110+
* @param methodHandler previous handler.
111+
*/
112+
void setPreviousHandler(MethodHandler methodHandler) {
113+
previousHandler = methodHandler;
114+
}
115+
}

0 commit comments

Comments
 (0)