marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sschaff...@apache.org
Subject [6/8] git commit: adapt to API changes in Guava
Date Tue, 16 Sep 2014 09:55:04 GMT
adapt to API changes in Guava


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/16dbb02b
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/16dbb02b
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/16dbb02b

Branch: refs/heads/develop
Commit: 16dbb02bd836186bf73cd0fcafe38e1383637699
Parents: 935f7c7
Author: Sebastian Schaffert <sschaffert@apache.org>
Authored: Tue Sep 16 11:06:34 2014 +0200
Committer: Sebastian Schaffert <sschaffert@apache.org>
Committed: Tue Sep 16 11:06:34 2014 +0200

----------------------------------------------------------------------
 .../platform/core/services/content/FileSystemContentReader.java  | 4 ++--
 .../platform/core/services/content/FileSystemContentWriter.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/16dbb02b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
index b0d9e02..2fb2aa2 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
@@ -151,7 +151,7 @@ public class FileSystemContentReader implements ContentReader {
                     File file = new File(path);
                     if(file.exists() && file.canRead()) {
                         log.debug("reading file content from file {} for resource {} ...",
file, resource);
-                        return Files.newInputStreamSupplier(file).getInput();
+                        return Files.asByteSource(file).openBufferedStream();
                     } else {
                         throw new FileNotFoundException("the file "+path+" does not exist
or is not readable");
                     }
@@ -244,7 +244,7 @@ public class FileSystemContentReader implements ContentReader {
                         Metadata metadata = new Metadata();
                         metadata.set(Metadata.RESOURCE_NAME_KEY, file.getAbsolutePath());
                         try {
-                            InputStream in = new BufferedInputStream(Files.newInputStreamSupplier(file).getInput());
+                            InputStream in = new BufferedInputStream(Files.asByteSource(file).openBufferedStream());
                             mimeType = detector.detect(in,metadata).toString();
                             in.close();
                         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/16dbb02b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
index 5a4af17..1e93285 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
@@ -210,7 +210,7 @@ public class FileSystemContentWriter implements ContentWriter {
                     }
                     if(file.exists() && file.canWrite()) {
                         log.debug("writing file content to file {} for resource {} ...",
file, resource);
-                        ByteStreams.copy(in, Files.newOutputStreamSupplier(file));
+                        ByteStreams.copy(in, Files.asByteSink(file).openBufferedStream());
                     } else {
                         throw new FileNotFoundException("could not write to file "+path+";
it does not exist or is not writable");
                     }


Mime
View raw message