Skip to content

Commit

Permalink
version 1.2020.11
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed May 30, 2020
1 parent 9ba7d08 commit 3192fa2
Show file tree
Hide file tree
Showing 181 changed files with 2,584 additions and 2,490 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2020.11-SNAPSHOT</version>
<version>1.2020.12-SNAPSHOT</version>
<packaging>jar</packaging>

<name>PlantUML</name>
Expand Down
15 changes: 4 additions & 11 deletions src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

import javax.imageio.ImageIO;
import net.sourceforge.plantuml.security.ImageIO;

import ext.plantuml.com.ctreber.acearth.renderer.RenderTarget;

Expand All @@ -30,17 +29,15 @@ public class PixelCanvas implements RenderTarget {
* <p>
* Construct a canvas of the specified size.
*
* @param pWidth
* Width
* @param pHeight
* Height
* @param pWidth Width
* @param pHeight Height
*/
public PixelCanvas(int pWidth, int pHeight) {
fImageWidth = pWidth;
fImageHeight = pHeight;
fEarthImage2 = new BufferedImage(fImageWidth, fImageHeight, BufferedImage.TYPE_INT_RGB);
}

public Graphics2D getGraphics2D() {
return fEarthImage2.createGraphics();
}
Expand All @@ -61,10 +58,6 @@ public int getImageHeight() {
return fImageHeight;
}

public boolean saveToImage(String pFileName, String pFormat) throws IOException {
return ImageIO.write(fEarthImage2, pFormat, new File(pFileName));
}

public void saveToImage(OutputStream os) throws IOException {
ImageIO.write(fEarthImage2, "png", os);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
package ext.plantuml.com.google.zxing.client.j2se;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

import javax.imageio.ImageIO;

import ext.plantuml.com.google.zxing.common.BitMatrix;

Expand Down
15 changes: 0 additions & 15 deletions src/jcckit/util/PropertiesBasedConfigData.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package jcckit.util;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
Expand All @@ -31,19 +29,6 @@
public class PropertiesBasedConfigData extends FlatConfigData {
private final Properties _properties;

/**
* Creates an instance from the specified <tt>.properties</tt> file.
* @param fileName File name of the <tt>.properties</tt> file relative
* to the working directory or absolute.
* @throws IOException if the <tt>.properties</tt> does not exist or could
* not be read.
*/
public PropertiesBasedConfigData(String fileName) throws IOException {
super(null);
_properties = new Properties();
_properties.load(new FileInputStream(fileName));
}

/**
* Creates an instance based on the specified properties.
* The path is undefined.
Expand Down
9 changes: 5 additions & 4 deletions src/net/sourceforge/plantuml/AFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@
*/
package net.sourceforge.plantuml;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import net.sourceforge.plantuml.security.SFile;

public interface AFile {

public InputStream open() throws IOException;
public InputStream openFile();

public boolean isOk();

public AParentFolder getParentFile();

public File getUnderlyingFile();
public SFile getUnderlyingFile();

public File getSystemFolder() throws IOException;
public SFile getSystemFolder() throws IOException;

}
18 changes: 9 additions & 9 deletions src/net/sourceforge/plantuml/AFileRegular.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@
*/
package net.sourceforge.plantuml;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import net.sourceforge.plantuml.security.SFile;

public class AFileRegular implements AFile {

private final File file;
private final SFile file;

@Override
public String toString() {
return "AFileRegular::" + file;
return "AFileRegular::" + file.getAbsolutePath();
}

public AFileRegular(File file) {
public AFileRegular(SFile file) {
this.file = file;
}

public InputStream open() throws IOException {
return new FileInputStream(file);
public InputStream openFile() {
return file.openFile();
}

public boolean isOk() {
Expand All @@ -78,11 +78,11 @@ public AParentFolder getParentFile() {
return new AParentFolderRegular(file.getParentFile());
}

public File getUnderlyingFile() {
public SFile getUnderlyingFile() {
return file;
}

public File getSystemFolder() throws IOException {
public SFile getSystemFolder() throws IOException {
return file.getParentFile().getCanonicalFile();
}

Expand Down
64 changes: 32 additions & 32 deletions src/net/sourceforge/plantuml/AFileZipEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,60 +35,60 @@
*/
package net.sourceforge.plantuml;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import net.sourceforge.plantuml.security.SFile;

public class AFileZipEntry implements AFile {

private final File zipFile;
private final SFile zipFile;
private final String entry;

public AFileZipEntry(File file, String entry) {
public AFileZipEntry(SFile file, String entry) {
this.zipFile = file;
this.entry = entry;
}

@Override
public String toString() {
return "AFileZipEntry::" + zipFile + " " + entry;
return "AFileZipEntry::" + zipFile.getAbsolutePath() + " " + entry;
}

public InputStream open() throws IOException {
final ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));
ZipEntry ze = zis.getNextEntry();
public InputStream openFile() {
final InputStream tmp = zipFile.openFile();
if (tmp != null)
try {
final ZipInputStream zis = new ZipInputStream(tmp);
ZipEntry ze = zis.getNextEntry();

while (ze != null) {
final String fileName = ze.getName();
if (ze.isDirectory()) {
} else if (fileName.trim().equalsIgnoreCase(entry.trim())) {
return zis;
while (ze != null) {
final String fileName = ze.getName();
if (ze.isDirectory()) {
} else if (fileName.trim().equalsIgnoreCase(entry.trim())) {
return zis;
}
ze = zis.getNextEntry();
}
zis.closeEntry();
zis.close();
} catch (IOException e) {
e.printStackTrace();
}
ze = zis.getNextEntry();
}
zis.closeEntry();
zis.close();
throw new IOException();
return null;
}

public boolean isOk() {
if (zipFile.exists() && zipFile.isDirectory() == false) {
InputStream is = null;
try {
is = open();
return true;
} catch (IOException e) {
// e.printStackTrace();
} finally {
final InputStream is = openFile();
if (is != null) {
try {
if (is != null) {
is.close();
}
} catch (IOException e1) {
e1.printStackTrace();
is.close();
return true;
} catch (IOException e) {
e.printStackTrace();
}
}
}
Expand All @@ -113,11 +113,11 @@ public AParentFolder getParentFile() {
return new AParentFolderZip(zipFile, entry);
}

public File getUnderlyingFile() {
public SFile getUnderlyingFile() {
return zipFile;
}

public File getSystemFolder() throws IOException {
public SFile getSystemFolder() throws IOException {
return zipFile.getParentFile().getCanonicalFile();
}

Expand Down
15 changes: 8 additions & 7 deletions src/net/sourceforge/plantuml/AParentFolderRegular.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,32 @@
*/
package net.sourceforge.plantuml;

import java.io.File;
import java.io.IOException;

import net.sourceforge.plantuml.security.SFile;

public class AParentFolderRegular implements AParentFolder {

private final File dir;
private final SFile dir;

public AParentFolderRegular(File dir) {
public AParentFolderRegular(SFile dir) {
this.dir = dir;
// Log.info("Creating AParentFolderRegular " + dir);
}

@Override
public String toString() {
return "AParentFolderRegular::" + (dir == null ? "NULL" : dir.getAbsolutePath());
return "AParentFolderRegular::" + (dir == null ? "NULL" : dir.getPrintablePath());
}

public AFile getAFile(String nameOrPath) throws IOException {
final File filecurrent;
final SFile filecurrent;
// Log.info("AParentFolderRegular::looking for " + nameOrPath);
// Log.info("AParentFolderRegular::dir = " + dir);
if (dir == null) {
filecurrent = new File(nameOrPath);
filecurrent = new SFile(nameOrPath);
} else {
filecurrent = new File(dir.getAbsoluteFile(), nameOrPath);
filecurrent = dir.getAbsoluteFile().file(nameOrPath);
}
// Log.info("AParentFolderRegular::Filecurrent " + filecurrent);
if (filecurrent.exists()) {
Expand Down
7 changes: 4 additions & 3 deletions src/net/sourceforge/plantuml/AParentFolderZip.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@
*/
package net.sourceforge.plantuml;

import java.io.File;
import java.io.IOException;

import net.sourceforge.plantuml.security.SFile;

public class AParentFolderZip implements AParentFolder {

private final File zipFile;
private final SFile zipFile;
private final String parent;

@Override
public String toString() {
return "AParentFolderZip::" + zipFile + " " + parent;
}

public AParentFolderZip(File zipFile, String entry) {
public AParentFolderZip(SFile zipFile, String entry) {
this.zipFile = zipFile;
final int idx = entry.lastIndexOf('/');
if (idx == -1) {
Expand Down
Loading

0 comments on commit 3192fa2

Please sign in to comment.