Skip to content

Commit de38261

Browse files
committed
4.7.4551
1 parent 97670a8 commit de38261

File tree

20 files changed

+234
-89
lines changed

20 files changed

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

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.6.4478</version>
9+
<version>4.7.4551</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.6.4478</version>
26+
<version>4.7.4551</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.6.4478</version>
128+
<version>4.7.4551</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.6.4478/META-INF</outputDirectory>
168+
<outputDirectory>${project.build.directory}/deltav-4.7.4551/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.6.4478</warSourceDirectory>
247+
<warSourceDirectory>target/deltav-4.7.4551</warSourceDirectory>
248248
</configuration>
249249
</plugin>
250250
<plugin>

Java/deltav/src/main/java/com/ithit/webdav/samples/deltavservlet/WebDavServlet.java

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@
88
import com.ithit.webdav.server.deltav.AutoVersion;
99
import com.ithit.webdav.server.exceptions.DavException;
1010
import com.ithit.webdav.server.exceptions.WebDavStatus;
11+
import org.apache.commons.io.FileUtils;
1112

1213
import javax.servlet.ServletConfig;
1314
import javax.servlet.ServletException;
1415
import javax.servlet.http.HttpServlet;
1516
import javax.servlet.http.HttpServletRequest;
1617
import javax.servlet.http.HttpServletResponse;
1718
import javax.servlet.http.HttpSession;
18-
import java.io.BufferedReader;
19-
import java.io.FileReader;
20-
import java.io.IOException;
21-
import java.io.PrintWriter;
19+
import java.io.*;
20+
import java.nio.charset.StandardCharsets;
2221
import java.nio.file.Files;
2322
import java.nio.file.Path;
2423
import java.nio.file.Paths;
@@ -38,27 +37,6 @@ public class WebDavServlet extends HttpServlet {
3837
private SearchFacade searchFacade;
3938
static final String START_TIME = "" + System.currentTimeMillis();
4039

41-
/**
42-
* Reads license file content.
43-
*
44-
* @param fileName License file location.
45-
* @return String license content.
46-
*/
47-
private static String getContents(String fileName) {
48-
StringBuilder contents = new StringBuilder();
49-
50-
try (BufferedReader input = new BufferedReader(new FileReader(fileName))) {
51-
String line;
52-
while ((line = input.readLine()) != null) {
53-
contents.append(line);
54-
contents.append(System.getProperty("line.separator"));
55-
}
56-
} catch (IOException ignored) {
57-
}
58-
59-
return contents.toString();
60-
}
61-
6240
/**
6341
* Return path of servlet location in file system to load resources.
6442
*
@@ -100,7 +78,11 @@ public void init(ServletConfig servletConfig) throws ServletException {
10078
autoputUnderVersionControl = "true".equals(servletConfig.getInitParameter("autoPutUnderVersionControl"));
10179
realPath = servletConfig.getServletContext().getRealPath("");
10280
servletContext = servletConfig.getServletContext().getContextPath();
103-
license = getContents(licenseFile);
81+
try {
82+
license = FileUtils.readFileToString(new File(licenseFile), StandardCharsets.UTF_8);
83+
} catch (IOException e) {
84+
license = "";
85+
}
10486
WebDavEngine engine = new WebDavEngine(logger, license);
10587
DataAccess dataAccess = new DataAccess(engine);
10688
String indexLocalPath = createIndexPath();

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.6.4478</version>
9+
<version>4.7.4551</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.6.4478</version>
37+
<version>4.7.4551</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.6.4478</version>
145+
<version>4.7.4551</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.6.4478</warSourceDirectory>
231+
<warSourceDirectory>target/filesystemstorage-4.7.4551</warSourceDirectory>
232232
</configuration>
233233
</plugin>
234234
<plugin>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void processRequest(DavRequest request, DavResponse response, HierarchyIt
4141
response.setContentType("text/html");
4242
if (!WebDavServlet.isSupportsUserDefinedAttributes()) {
4343
Path path = Paths.get(WebDavServlet.getRealPath(), pathToErrorHTML);
44-
String lines = FileUtils.readFileToString(path.toFile(), Charset.defaultCharset());
44+
String lines = FileUtils.readFileToString(path.toFile(), StandardCharsets.UTF_8);
4545
stream.println(lines);
4646
} else {
4747
Path path = Paths.get(WebDavServlet.getRealPath(), pathToHTML);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.io.File;
2121
import java.io.IOException;
2222
import java.io.PrintStream;
23+
import java.nio.charset.StandardCharsets;
2324
import java.nio.file.Files;
2425
import java.nio.file.Path;
2526
import java.nio.file.Paths;
@@ -92,7 +93,7 @@ public void init(ServletConfig servletConfig) throws ServletException {
9293
String licenseFile = servletConfig.getInitParameter("license");
9394
showExceptions = Boolean.parseBoolean(servletConfig.getInitParameter("showExceptions"));
9495
try {
95-
license = FileUtils.readFileToString(new File(licenseFile));
96+
license = FileUtils.readFileToString(new File(licenseFile), StandardCharsets.UTF_8);
9697
} catch (IOException e) {
9798
license = "";
9899
}

Java/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>4.6.4478</version>
9+
<version>4.7.4551</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.6.4478</version>
26+
<version>4.7.4551</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.6.4478</version>
128+
<version>4.7.4551</version>
129129
</dependency>
130130

131131
<dependency>
@@ -165,7 +165,7 @@
165165
<goal>copy-resources</goal>
166166
</goals>
167167
<configuration>
168-
<outputDirectory>${project.build.directory}/oraclestorage-4.6.4478/META-INF</outputDirectory>
168+
<outputDirectory>${project.build.directory}/oraclestorage-4.7.4551/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/oraclestorage-4.6.4478</warSourceDirectory>
247+
<warSourceDirectory>target/oraclestorage-4.7.4551</warSourceDirectory>
248248
</configuration>
249249
</plugin>
250250
<plugin>

Java/oraclestorage/src/main/java/com/ithit/webdav/samples/oraclestorageservlet/WebDavServlet.java

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
import com.ithit.webdav.server.Logger;
88
import com.ithit.webdav.server.exceptions.DavException;
99
import com.ithit.webdav.server.exceptions.WebDavStatus;
10+
import org.apache.commons.io.FileUtils;
1011

1112
import javax.servlet.ServletConfig;
1213
import javax.servlet.ServletException;
1314
import javax.servlet.http.HttpServlet;
1415
import javax.servlet.http.HttpServletRequest;
1516
import javax.servlet.http.HttpServletResponse;
1617
import javax.servlet.http.HttpSession;
17-
import java.io.BufferedReader;
18-
import java.io.FileReader;
19-
import java.io.IOException;
20-
import java.io.PrintStream;
18+
import java.io.*;
19+
import java.nio.charset.StandardCharsets;
2120
import java.nio.file.Files;
2221
import java.nio.file.Path;
2322
import java.nio.file.Paths;
@@ -35,27 +34,6 @@ public class WebDavServlet extends HttpServlet {
3534
private SearchFacade searchFacade;
3635
static final String START_TIME = "" + System.currentTimeMillis();
3736

38-
/**
39-
* Reads license file content.
40-
*
41-
* @param fileName License file location.
42-
* @return String license content.
43-
*/
44-
private static String getContents(String fileName) {
45-
StringBuilder contents = new StringBuilder();
46-
47-
try (BufferedReader input = new BufferedReader(new FileReader(fileName))) {
48-
String line;
49-
while ((line = input.readLine()) != null) {
50-
contents.append(line);
51-
contents.append(System.getProperty("line.separator"));
52-
}
53-
} catch (IOException ignored) {
54-
}
55-
56-
return contents.toString();
57-
}
58-
5937
/**
6038
* Return path of servlet location in file system to load resources.
6139
*
@@ -86,7 +64,11 @@ public void init(ServletConfig servletConfig) throws ServletException {
8664

8765
String licenseFile = servletConfig.getInitParameter("license");
8866
showExceptions = "true".equals(servletConfig.getInitParameter("showExceptions"));
89-
license = getContents(licenseFile);
67+
try {
68+
license = FileUtils.readFileToString(new File(licenseFile), StandardCharsets.UTF_8);
69+
} catch (IOException e) {
70+
license = "";
71+
}
9072
realPath = servletConfig.getServletContext().getRealPath("");
9173
servletContext = servletConfig.getServletContext().getContextPath();
9274
logger = new HttpServletLoggerImpl(servletConfig.getServletContext());

Java/springbootfsstorage/pom.xml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
<parent>
55
<groupId>org.springframework.boot</groupId>
66
<artifactId>spring-boot-starter-parent</artifactId>
7-
<version>2.2.4.RELEASE</version>
7+
<version>2.3.8.RELEASE</version>
88
<relativePath /> <!-- lookup parent from repository -->
99
</parent>
1010
<groupId>com.ithit.webdav.samples</groupId>
1111
<artifactId>springbootfsstorage</artifactId>
12-
<version>4.6.4478</version>
12+
<version>4.7.4551</version>
1313
<name>springbootfsstorage</name>
1414
<description>Demo project for Spring Boot</description>
1515

1616
<properties>
17+
<azure.version>3.1.0</azure.version>
1718
<java.version>1.8</java.version>
1819
<lucene-core.version>7.5.0</lucene-core.version>
1920
<tika-core.version>1.23</tika-core.version>
@@ -38,24 +39,32 @@
3839
<artifactId>lombok</artifactId>
3940
<optional>true</optional>
4041
</dependency>
42+
<dependency>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-starter-oauth2-client</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>com.azure.spring</groupId>
48+
<artifactId>azure-spring-boot-starter-active-directory</artifactId>
49+
</dependency>
4150

4251
<!-- WebDav dependencies -->
4352
<dependency>
4453
<groupId>com.ithit.webdav</groupId>
4554
<artifactId>webdav-server</artifactId>
46-
<version>4.6.4478</version>
55+
<version>4.7.4551</version>
4756
</dependency>
4857
<dependency>
4958
<groupId>com.ithit.webdav.integration</groupId>
5059
<artifactId>servlet-integration</artifactId>
51-
<version>4.6.4478</version>
60+
<version>4.7.4551</version>
5261
</dependency>
5362

5463
<!-- JNA dependencies -->
5564
<dependency>
5665
<groupId>net.java.dev.jna</groupId>
5766
<artifactId>jna-platform</artifactId>
58-
<version>5.4.0</version>
67+
<version>4.5.1</version>
5968
</dependency>
6069

6170
<!-- Gson -->
@@ -193,4 +202,15 @@
193202
</plugins>
194203
</build>
195204

205+
<dependencyManagement>
206+
<dependencies>
207+
<dependency>
208+
<groupId>com.azure.spring</groupId>
209+
<artifactId>azure-spring-boot-bom</artifactId>
210+
<version>${azure.version}</version>
211+
<type>pom</type>
212+
<scope>import</scope>
213+
</dependency>
214+
</dependencies>
215+
</dependencyManagement>
196216
</project>

Java/springbootfsstorage/src/main/java/com/ithit/webdav/samples/springbootfs/SpringBootSampleApplication.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
56

6-
@SpringBootApplication
7+
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
78
public class SpringBootSampleApplication {
89

910
public static void main(String[] args) {

0 commit comments

Comments
 (0)