Author: rombert
Date: Fri Jul 19 15:02:53 2013
New Revision: 1504899

URL: http://svn.apache.org/r1504899
Log:
SLING-2973 - [Tooling] Align Eclipse tooling to proposed structure

Allow creating directory nodes as well with the newAddNodeCommand

Modified:
    
sling/whiteboard/asanso/plugins/eclipse/slingclipse-http/src/org/apache/sling/slingclipse/http/impl/RepositoryImpl.java

Modified: 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-http/src/org/apache/sling/slingclipse/http/impl/RepositoryImpl.java
URL: 
http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-http/src/org/apache/sling/slingclipse/http/impl/RepositoryImpl.java?rev=1504899&r1=1504898&r2=1504899&view=diff
==============================================================================
--- 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-http/src/org/apache/sling/slingclipse/http/impl/RepositoryImpl.java
 (original)
+++ 
sling/whiteboard/asanso/plugins/eclipse/slingclipse-http/src/org/apache/sling/slingclipse/http/impl/RepositoryImpl.java
 Fri Jul 19 15:02:53 2013
@@ -49,8 +49,10 @@ public class RepositoryImpl extends Abst
                                PostMethod post = new 
PostMethod(repositoryInfo.getUrl()+fileInfo.getRelativeLocation());
                                try{
                                        File f=new File(fileInfo.getLocation());
-                                       Part[] parts ={ new 
FilePart(fileInfo.getName(), f)};
-                                       post.setRequestEntity(new 
MultipartRequestEntity(parts,post.getParams()));
+                    if (f.isFile()) {
+                        Part[] parts = { new FilePart(fileInfo.getName(), f) };
+                        post.setRequestEntity(new 
MultipartRequestEntity(parts, post.getParams()));
+                    }
                                        
httpClient.getState().setCredentials(AuthScope.ANY, new 
UsernamePasswordCredentials(repositoryInfo.getUsername(),repositoryInfo.getPassword()));
                                        
httpClient.getParams().setAuthenticationPreemptive(true);
                                        int 
responseStatus=httpClient.executeMethod(post);


Reply via email to