[hg] main-silver: extend class to use for non java.io.File based...
- From: Alexander Simon < >
- To:
- Subject: [hg] main-silver: extend class to use for non java.io.File based...
- Date: Thu, 02 Feb 2012 04:30:17 -0800
changeset df1e0205783f in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/df1e0205783f
description:
extend class to use for non java.io.File based content.
diffstat:
versioning.util/nbproject/project.properties
| 2 +-
versioning.util/nbproject/project.xml
| 1 +
versioning.util/src/org/netbeans/modules/versioning/historystore/Storage.java
| 25 ++++++++++
3 files changed, 27 insertions(+), 1 deletions(-)
diffs (65 lines):
diff --git a/versioning.util/nbproject/project.properties
b/versioning.util/nbproject/project.properties
--- a/versioning.util/nbproject/project.properties
+++ b/versioning.util/nbproject/project.properties
@@ -44,7 +44,7 @@
javac.source=1.6
javadoc.name=Versioning Support Utilities
-spec.version.base=1.19.0.6
+spec.version.base=1.20.0.6
is.autoload=true
# Fatal error: Fatal error: class javax.net.SocketFactory not found
diff --git a/versioning.util/nbproject/project.xml
b/versioning.util/nbproject/project.xml
--- a/versioning.util/nbproject/project.xml
+++ b/versioning.util/nbproject/project.xml
@@ -273,6 +273,7 @@
</test-type>
</test-dependencies>
<friend-packages>
+ <friend>org.netbeans.modules.ade</friend>
<friend>org.netbeans.modules.bugtracking.bridge</friend>
<friend>org.netbeans.modules.clearcase</friend>
<friend>org.netbeans.modules.git</friend>
diff --git
a/versioning.util/src/org/netbeans/modules/versioning/historystore/Storage.java
b/versioning.util/src/org/netbeans/modules/versioning/historystore/Storage.java
---
a/versioning.util/src/org/netbeans/modules/versioning/historystore/Storage.java
+++
b/versioning.util/src/org/netbeans/modules/versioning/historystore/Storage.java
@@ -57,6 +57,7 @@
import java.security.NoSuchAlgorithmException;
import java.util.logging.Level;
import org.netbeans.modules.versioning.util.Utils;
+import org.openide.util.Exceptions;
import org.openide.util.NbPreferences;
/**
@@ -124,6 +125,30 @@
* Stores file's content in the given revision
* @param repositoryPath repository path to the file
* @param revision revision of the file's content
+ * @param content input stream of the file in the given revision
+ */
+ public synchronized void setContent (String repositoryPath, String
revision, InputStream content) {
+ if (ensureAccessible()) {
+ Entry entry = getEntry(repositoryPath, revision, true);
+ try {
+ OutputStream os = entry.getStoreFileOutputStream();
+ Utils.copyStreamsCloseAll(os, content);
+ } catch (IOException ex) {
+ StorageManager.LOG.log(Level.INFO, "setContent(): Cannot
save stream's content", ex); //NOI18N
+ }
+ } else {
+ try {
+ content.close();
+ } catch (IOException ex) {
+ StorageManager.LOG.log(Level.INFO, "setContent(): Cannot
close stream's content", ex); //NOI18N
+ }
+ }
+ }
+
+ /**
+ * Stores file's content in the given revision
+ * @param repositoryPath repository path to the file
+ * @param revision revision of the file's content
* @param content content of the file in the given revision
*/
public synchronized void setContent (String repositoryPath, String
revision, File content) {
|
[hg] main-silver: extend class to use for non java.io.File based... |
Alexander Simon | 02/02/2012 |
