zurb/foundation project generator: download from "http://foundation.zurb.com/cdn...
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 30 Oct 2014 08:40:26 +0000 (11:40 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 30 Oct 2014 08:40:26 +0000 (11:40 +0300)
platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/AbstractGithubTagDownloadedProjectGenerator.java
platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubDownloadUtil.java
platform/lang-impl/src/com/intellij/platform/templates/github/DownloadUtil.java

index 6ab678bf722c0c9283c89da166ed60afcd24a620..60151b27006c91c6065d9ac4d7c6420926ab013c 100644 (file)
@@ -7,6 +7,7 @@ import com.intellij.openapi.module.Module;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.vfs.VfsUtilCore;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.platform.templates.github.GeneratorException;
 import com.intellij.platform.templates.github.GithubTagInfo;
@@ -61,7 +62,7 @@ public abstract class AbstractGithubTagDownloadedProjectGenerator extends WebPro
   public void generateProject(@NotNull final Project project, @NotNull final VirtualFile baseDir,
                               @NotNull GithubTagInfo tag, @NotNull Module module) {
     try {
-      unpackToDir(project, new File(baseDir.getPath()), tag);
+      unpackToDir(project, VfsUtilCore.virtualToIoFile(baseDir), tag);
     }
     catch (GeneratorException e) {
       showErrorMessage(project, e.getMessage());
index 46386b27461c63ed639b2ee9c2c386eca27f34ea..4a3e7cf8584bfa5b2d9d70432267a44a249f9ecf 100644 (file)
@@ -83,7 +83,7 @@ public class GithubDownloadUtil {
     }
     Exception e = outcome.getException();
     if (e != null) {
-      throw new GeneratorException("Can not fetch content from " + url);
+      throw new GeneratorException("Can not fetch content from " + url, e);
     }
     throw new GeneratorException("Download was cancelled");
   }
index 02ddd0b646087d09768b2e16dff050b80a92e660..0879df6ce464f4b68079f9fc3bc36b336270b2e2 100644 (file)
@@ -138,7 +138,7 @@ public class DownloadUtil {
       if (latestInnerException == null) {
         return Outcome.createNormal(dataRef.get());
       }
-      LOG.warn("[attempt#" + attemptNumber + "] Can not '" + actionShortDescription + "'", latestInnerException);
+      LOG.info("[attempt#" + attemptNumber + "] Cannot '" + actionShortDescription + "'");
       boolean onceMore = false;
       if (tryAgainProvider != null) {
         onceMore = Boolean.TRUE.equals(tryAgainProvider.produce());