Commit 30f13b06 authored by Riegel's avatar Riegel
Browse files

Docs: Add Javadoc

parent 1cf6605c
This commit is part of merge request !26. Comments created here will be created in the context of that merge request.
Showing with 13 additions and 6 deletions
+13 -6
...@@ -42,7 +42,7 @@ public class CityGmlZipEntryFile implements AutoCloseable { ...@@ -42,7 +42,7 @@ public class CityGmlZipEntryFile implements AutoCloseable {
*/ */
public InputStream getInputStream() throws IOException { public InputStream getInputStream() throws IOException {
if (closed){ if (closed){
throw new IOException("Stream closed"); throw new IOException("CityGmlZipEntryFile closed");
} }
return zip.getInputStream(zipEntry); return zip.getInputStream(zipEntry);
} }
...@@ -54,7 +54,7 @@ public class CityGmlZipEntryFile implements AutoCloseable { ...@@ -54,7 +54,7 @@ public class CityGmlZipEntryFile implements AutoCloseable {
*/ */
public long getFileSize() throws IOException { public long getFileSize() throws IOException {
if (closed){ if (closed){
throw new IOException("Stream closed"); throw new IOException("CityGmlZipEntryFile closed");
} }
if (cgmlZipEntry.getFileSize() == -1L) { if (cgmlZipEntry.getFileSize() == -1L) {
if (zipEntry.getSize() == -1) { if (zipEntry.getSize() == -1) {
......
...@@ -2,6 +2,9 @@ package de.hft.stuttgart.citydoctor2.zip; ...@@ -2,6 +2,9 @@ package de.hft.stuttgart.citydoctor2.zip;
import java.util.zip.ZipException; import java.util.zip.ZipException;
/**
* Signals that a ZIP-file is corrupted and couldn't be parsed.
*/
public class MalformedZipFileException extends ZipException { public class MalformedZipFileException extends ZipException {
public MalformedZipFileException() { public MalformedZipFileException() {
......
...@@ -316,6 +316,11 @@ public class CheckDialog { ...@@ -316,6 +316,11 @@ public class CheckDialog {
showZipArchiveOptions(false); showZipArchiveOptions(false);
} }
/**
* Shows the option panel for ZIP-Archive checking and enables the ZIP-Archive checking mode for this dialog.
*
* @param enabled
*/
public void showZipArchiveOptions(boolean enabled) { public void showZipArchiveOptions(boolean enabled) {
zipArchiveOptionsVBox.setDisable(!enabled); zipArchiveOptionsVBox.setDisable(!enabled);
zipArchiveOptionsVBox.setVisible(enabled); zipArchiveOptionsVBox.setVisible(enabled);
......
...@@ -34,6 +34,9 @@ import java.io.IOException; ...@@ -34,6 +34,9 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.function.Predicate; import java.util.function.Predicate;
/**
* This class implements a GUI for managing a loaded {@link CityGmlZipArchive} in CityDoctor.
*/
public class ZipEntryManager { public class ZipEntryManager {
private static final Logger logger = LogManager.getLogger(ZipEntryManager.class); private static final Logger logger = LogManager.getLogger(ZipEntryManager.class);
...@@ -217,10 +220,6 @@ public class ZipEntryManager { ...@@ -217,10 +220,6 @@ public class ZipEntryManager {
} }
CityGmlZipEntry entry = entryList.getSelectionModel().getSelectedItem().getEntry(); CityGmlZipEntry entry = entryList.getSelectionModel().getSelectedItem().getEntry();
if (entry.getErrorType() != null) { if (entry.getErrorType() != null) {
/**
* Button should be disabled when an erroneous entry gets selected.
* Silently fail in case an erroneous entry is somehow selected on Action.
*/
logger.debug("IllegalState: loadBtn was pressed while an erroneous entry was selected"); logger.debug("IllegalState: loadBtn was pressed while an erroneous entry was selected");
populateZipEntryList(selectedIndex); populateZipEntryList(selectedIndex);
return; return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment