Skip to content

Commit d86ff87

Browse files
Removed constraint that a basepath must be set for a package to contain an image file. Version bump of Tableschema lib
1 parent 9284448 commit d86ff87

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>io.frictionlessdata</groupId>
66
<artifactId>datapackage-java</artifactId>
7-
<version>0.6.5-SNAPSHOT</version>
7+
<version>0.6.7-SNAPSHOT</version>
88
<packaging>jar</packaging>
99
<issueManagement>
1010
<url>https://github.com/frictionlessdata/datapackage-java/issues</url>
@@ -22,7 +22,7 @@
2222
<java.version>8</java.version>
2323
<maven.compiler.source>${java.version}</maven.compiler.source>
2424
<maven.compiler.target>${java.version}</maven.compiler.target>
25-
<tableschema-java-version>0.6.5</tableschema-java-version>
25+
<tableschema-java-version>0.6.7</tableschema-java-version>
2626
<hamcrest.version>1.3</hamcrest.version>
2727
<junit.version>5.9.1</junit.version>
2828
<slf4j-simple.version>2.0.5</slf4j-simple.version>

src/main/java/io/frictionlessdata/datapackage/Package.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,8 @@ public void write (File outputDir, boolean zipCompressed) throws Exception {
525525
writeDescriptor(outFs, parentDirName);
526526

527527
if (null != imageData) {
528-
if (null == getBasePath()) {
529-
if (null != getBaseUrl()) {
530-
throw new DataPackageException("Cannot add image data to a package read from an URL");
531-
}
532-
throw new DataPackageException("Invalid package, base path is null");
528+
if (null != getBaseUrl()) {
529+
throw new DataPackageException("Cannot add image data to a package read from an URL");
533530
}
534531
String fileName = (!StringUtils.isEmpty(this.image)) ? this.image : "image-file";
535532
String sanitizedFileName = fileName.replaceAll("[\\s/\\\\]+", "_");
@@ -546,8 +543,10 @@ public void write (File outputDir, boolean zipCompressed) throws Exception {
546543
}
547544
}
548545
}
549-
// ZIP-FS needs close, but WindowsFileSystem unsurprisingly doesn't
550-
// like to get closed...
546+
/* ZIP-FS needs close, but WindowsFileSystem unsurprisingly doesn't
547+
like to get closed...
548+
The empty catch block is intentional.
549+
*/
551550
try {
552551
outFs.close();
553552
} catch (UnsupportedOperationException es) {};

0 commit comments

Comments
 (0)