jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1127827 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistentId.java
Date Thu, 26 May 2011 08:51:38 GMT
Author: stefan
Date: Thu May 26 08:51:38 2011
New Revision: 1127827

URL: http://svn.apache.org/viewvc?rev=1127827&view=rev
Log:
MicroKernel prototype (WIP)

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistentId.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistentId.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistentId.java?rev=1127827&r1=1127826&r2=1127827&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistentId.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistentId.java
Thu May 26 08:51:38 2011
@@ -16,8 +16,10 @@
  */
 package org.apache.jackrabbit.mk.store;
 
+import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -48,6 +50,11 @@ public class PersistentId {
     public String get() throws IOException {
         rwLock.readLock().lock();
         try {
+            if (id == null) {
+                DataInputStream in = new DataInputStream(new FileInputStream(file));
+                id = in.readUTF();
+                in.close();
+            }
             return id;
         } finally {
             rwLock.readLock().unlock();



Mime
View raw message