Remove zip file handling code and zip4j dependency
.zip files were only used to cache compiled Java rules, and the new rule system has nothing to cache.
This commit is contained in:
parent
12406c787b
commit
d8f401cb22
@ -70,10 +70,6 @@ public interface Platform {
|
||||
*/
|
||||
List<String> getRuleFilePaths() throws IOException;
|
||||
|
||||
void zip(String targetPath, String destinationFilePath, String password);
|
||||
|
||||
void unzip(String targetZipFilePath, String destinationFolderPath, String password);
|
||||
|
||||
public interface Gpio {
|
||||
int valueOutput();
|
||||
|
||||
|
@ -28,11 +28,6 @@
|
||||
<artifactId>jansi</artifactId>
|
||||
<version>1.17.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ar.com.hjg</groupId>
|
||||
<artifactId>pngj</artifactId>
|
||||
|
@ -19,9 +19,6 @@ import it.cavallium.warppi.gui.graphicengine.impl.jogl.JOGLEngine;
|
||||
import it.cavallium.warppi.gui.graphicengine.impl.swing.SwingEngine;
|
||||
import it.cavallium.warppi.util.CacheUtils;
|
||||
import it.cavallium.warppi.util.Error;
|
||||
import net.lingala.zip4j.core.ZipFile;
|
||||
import net.lingala.zip4j.model.ZipParameters;
|
||||
import net.lingala.zip4j.util.Zip4jConstants;
|
||||
|
||||
public class DesktopPlatform implements Platform {
|
||||
|
||||
@ -173,46 +170,6 @@ public class DesktopPlatform implements Platform {
|
||||
return paths;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void zip(final String targetPath, final String destinationFilePath, final String password) {
|
||||
try {
|
||||
final ZipParameters parameters = new ZipParameters();
|
||||
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
|
||||
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
|
||||
|
||||
if (password.length() > 0) {
|
||||
parameters.setEncryptFiles(true);
|
||||
parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
|
||||
parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
|
||||
parameters.setPassword(password);
|
||||
}
|
||||
|
||||
final ZipFile zipFile = new ZipFile(destinationFilePath);
|
||||
|
||||
final File targetFile = new File(targetPath);
|
||||
if (targetFile.isFile())
|
||||
zipFile.addFile(targetFile, parameters);
|
||||
else if (targetFile.isDirectory())
|
||||
zipFile.addFolder(targetFile, parameters);
|
||||
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unzip(final String targetZipFilePath, final String destinationFolderPath, final String password) {
|
||||
try {
|
||||
final ZipFile zipFile = new ZipFile(targetZipFilePath);
|
||||
if (zipFile.isEncrypted())
|
||||
zipFile.setPassword(password);
|
||||
zipFile.extractAll(destinationFolderPath);
|
||||
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunningOnRaspberry(boolean b) {
|
||||
if (isRunningOnRaspberry()) {
|
||||
|
@ -30,11 +30,6 @@
|
||||
<artifactId>pi4j-core</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ar.com.hjg</groupId>
|
||||
<artifactId>pngj</artifactId>
|
||||
|
@ -15,9 +15,6 @@ import it.cavallium.warppi.gui.graphicengine.GraphicEngine;
|
||||
import it.cavallium.warppi.gui.graphicengine.impl.framebuffer.FBEngine;
|
||||
import it.cavallium.warppi.gui.graphicengine.impl.jogl.JOGLEngine;
|
||||
import it.cavallium.warppi.util.Error;
|
||||
import net.lingala.zip4j.core.ZipFile;
|
||||
import net.lingala.zip4j.model.ZipParameters;
|
||||
import net.lingala.zip4j.util.Zip4jConstants;
|
||||
|
||||
public class HardwarePlatform implements Platform {
|
||||
|
||||
@ -163,46 +160,6 @@ public class HardwarePlatform implements Platform {
|
||||
return paths;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void zip(final String targetPath, final String destinationFilePath, final String password) {
|
||||
try {
|
||||
final ZipParameters parameters = new ZipParameters();
|
||||
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
|
||||
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
|
||||
|
||||
if (password.length() > 0) {
|
||||
parameters.setEncryptFiles(true);
|
||||
parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES);
|
||||
parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256);
|
||||
parameters.setPassword(password);
|
||||
}
|
||||
|
||||
final ZipFile zipFile = new ZipFile(destinationFilePath);
|
||||
|
||||
final File targetFile = new File(targetPath);
|
||||
if (targetFile.isFile())
|
||||
zipFile.addFile(targetFile, parameters);
|
||||
else if (targetFile.isDirectory())
|
||||
zipFile.addFolder(targetFile, parameters);
|
||||
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unzip(final String targetZipFilePath, final String destinationFolderPath, final String password) {
|
||||
try {
|
||||
final ZipFile zipFile = new ZipFile(targetZipFilePath);
|
||||
if (zipFile.isEncrypted())
|
||||
zipFile.setPassword(password);
|
||||
zipFile.extractAll(destinationFolderPath);
|
||||
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunningOnRaspberry(boolean b) {
|
||||
runningOnRaspberryOverride = b;
|
||||
|
@ -157,16 +157,6 @@ public class TeaVMPlatform implements Platform {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void zip(final String targetPath, final String destinationFilePath, final String password) {
|
||||
throw new java.lang.UnsupportedOperationException("Not implemented.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unzip(final String targetZipFilePath, final String destinationFolderPath, final String password) {
|
||||
throw new java.lang.UnsupportedOperationException("Not implemented.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunningOnRaspberry(boolean b) {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user