incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1086508 - /sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/FileNodeConverter.java
Date Tue, 29 Mar 2011 08:05:01 GMT
Author: cziegeler
Date: Tue Mar 29 08:05:01 2011
New Revision: 1086508

URL: http://svn.apache.org/viewvc?rev=1086508&view=rev
Log:
Clean up code - existence of properties is already checked before method is invoked

Modified:
    sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/FileNodeConverter.java

Modified: sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/FileNodeConverter.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/FileNodeConverter.java?rev=1086508&r1=1086507&r2=1086508&view=diff
==============================================================================
--- sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/FileNodeConverter.java
(original)
+++ sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/FileNodeConverter.java
Tue Mar 29 08:05:01 2011
@@ -66,20 +66,9 @@ public class FileNodeConverter implement
 	        final String path,
 	        final int priority)
     throws IOException, RepositoryException {
-		String digest = null;
-        if (n.hasProperty(JCR_CONTENT_LAST_MODIFIED)) {
-        	digest = String.valueOf(n.getProperty(JCR_CONTENT_LAST_MODIFIED).getDate().getTimeInMillis());
-        } else {
-        	throw new IOException("Missing " + JCR_CONTENT_LAST_MODIFIED + " property");
-	    }
-
-        InputStream is = null;
-        if(n.hasProperty(JCR_CONTENT_DATA)) {
-        	is = n.getProperty(JCR_CONTENT_DATA).getStream();
-        } else {
-        	throw new IOException("Missing " + JCR_CONTENT_DATA + " property");
-        }
+		final String digest = String.valueOf(n.getProperty(JCR_CONTENT_LAST_MODIFIED).getDate().getTimeInMillis());
 
+        final InputStream is =  n.getProperty(JCR_CONTENT_DATA).getStream();
         final Dictionary<String, Object> dict = new Hashtable<String, Object>();
         dict.put(InstallableResource.INSTALLATION_HINT, n.getParent().getName());
         return new InstallableResource(path, is, dict, digest, null, priority);



Mime
View raw message