Author: kcardineaud Date: 2011-08-16 12:31:44 +0200 (Tue, 16 Aug 2011) New Revision: 216 Url: http://nuiton.org/repositories/revision/scmwebeditor/216 Log: It is now possible to create directory on repository when upload a file Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-08-16 08:49:20 UTC (rev 215) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-08-16 10:31:44 UTC (rev 216) @@ -217,9 +217,9 @@ try { if (log.isDebugEnabled()) { - log.debug("Do Checkout of " + svnPath); + log.debug("Do Checkout of " + svnRoot); } - upclient.doCheckout(SVNURL.parseURIEncoded(svnPath), checkoutDir, + upclient.doCheckout(SVNURL.parseURIEncoded(svnRoot), checkoutDir, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, false); } catch (SVNAuthenticationException authexep) { @@ -244,22 +244,22 @@ - //On test si le chemin commence par un / si non, on l'ajoute - if(!svnPath.startsWith("/")) { - svnPath="/"+svnPath; - } +// //On test si le chemin commence par un / si non, on l'ajoute +// if(!svnPath.startsWith("/")) { +// svnPath="/"+svnPath; +// } //On test si le chemin se termine par un / si non, on l'ajoute if(!svnPath.endsWith("/")) { svnPath+=("/"); } - + //Copy file in checkourdir String checkoutPath = checkoutDir.getAbsolutePath(); -// File file = new File(checkoutPath+svnPath,uploadFileName); - File file = new File(checkoutPath,uploadFileName); + File file = new File(checkoutPath+svnPath.replace(svnRoot, ""),uploadFileName); + try { FileUtils.copyFile(upload, file); } catch (IOException e) { @@ -281,7 +281,7 @@ try { if(log.isDebugEnabled()) { - log.debug("leSvnPath : "+checkoutPath+uploadFileName); + log.debug("leSvnPath : "+file.toString()); } //On ajoute le repertoire @@ -289,7 +289,7 @@ if(log.isDebugEnabled()) { log.debug("Add success !"); } - //On ajoute l'image aux fichiers versionnés + //On ajoute le fichier aux fichiers versionnés } catch (SVNException e) {
participants (1)
-
kcardineaud@users.nuiton.org