Skip to content

Commit fc8e970

Browse files
author
ahmadsebak
committed
fixed static content and length of deployment for raspberry pi
1 parent 7da76fd commit fc8e970

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

META-INF/plugin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<idea-plugin version="2">
22
<id>com.atsebak.raspberrypi</id>
33
<name>Raspberry Pi</name>
4-
<version>0.11</version>
4+
<version>0.15</version>
55
<vendor email="[email protected]" url="http://www.atsebak.com">At Sebak</vendor>
66

77
<description><![CDATA[
88
<p>Raspberry PI Intellij Plugin</p>
99
]]></description>
1010

1111
<change-notes><![CDATA[
12-
Fixed several small issues.
12+
Fixed Length of content that can be deployed on remote device.
1313
]]>
1414
</change-notes>
1515

src/com/atsebak/raspberrypi/commandline/AppCommandLineState.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public void run() {
181181
File classpathArchive = FileUtilities.createClasspathArchive(files, project);
182182
invokeDeployment(classpathArchive.getPath(), build);
183183
} catch (Exception e) {
184+
e.printStackTrace();
184185
PIConsoleView.getInstance(environment.getProject()).print(PIBundle.message("pi.connection.failed", e.getLocalizedMessage()),
185186
ConsoleViewContentType.ERROR_OUTPUT);
186187
}

src/com/atsebak/raspberrypi/utils/FileUtilities.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33

44
import com.intellij.openapi.project.Project;
5-
import org.apache.commons.compress.archivers.ArchiveException;
6-
import org.apache.commons.compress.archivers.ArchiveOutputStream;
7-
import org.apache.commons.compress.archivers.ArchiveStreamFactory;
85
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
6+
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
97
import org.apache.commons.compress.utils.IOUtils;
108

119
import java.io.*;
1210
import java.util.Collection;
1311
import java.util.LinkedList;
12+
import java.util.zip.GZIPOutputStream;
1413
import java.util.zip.ZipEntry;
1514
import java.util.zip.ZipInputStream;
1615

@@ -74,10 +73,11 @@ public static File createClasspathArchive(Collection<File> classpathEntries, Pro
7473
}
7574

7675
FileOutputStream fileOutputStream = null;
77-
ArchiveOutputStream archiveOutputStream = null;
76+
TarArchiveOutputStream archiveOutputStream = null;
7877
try {
7978
fileOutputStream = new FileOutputStream(archiveFile);
80-
archiveOutputStream = new ArchiveStreamFactory().createArchiveOutputStream(ArchiveStreamFactory.TAR, fileOutputStream);
79+
archiveOutputStream = new TarArchiveOutputStream(new GZIPOutputStream(fileOutputStream));
80+
archiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
8181
LinkedList<String> pathElements = new LinkedList<String>();
8282
for (File f : classpathEntries) {
8383
if (f.isFile()) { //is a jar file
@@ -92,8 +92,6 @@ public static File createClasspathArchive(Collection<File> classpathEntries, Pro
9292
pathElements.removeLast();
9393
}
9494
return archiveFile;
95-
} catch (ArchiveException e) {
96-
throw new IOException();
9795
} finally {
9896
if (archiveOutputStream != null) {
9997
archiveOutputStream.close();
@@ -110,8 +108,9 @@ public static File createClasspathArchive(Collection<File> classpathEntries, Pro
110108
* @param archiveOutputStream
111109
* @throws IOException
112110
*/
113-
private static void writeClassPath(LinkedList<String> pathElements, File entry, ArchiveOutputStream archiveOutputStream) throws IOException {
111+
private static void writeClassPath(LinkedList<String> pathElements, File entry, TarArchiveOutputStream archiveOutputStream) throws IOException {
114112
if (entry.isFile()) {
113+
archiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
115114
archiveOutputStream.putArchiveEntry(new TarArchiveEntry(entry, getPath(pathElements) + File.separator + entry.getName()));
116115
copy(entry, archiveOutputStream);
117116
archiveOutputStream.closeArchiveEntry();

0 commit comments

Comments
 (0)