Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/maylencita/epublib into m…
Browse files Browse the repository at this point in the history
…aylencita-master

Conflicts:
	epublib-core/src/main/java/nl/siegmann/epublib/domain/Resource.java
  • Loading branch information
psiegman committed Sep 9, 2013
2 parents 1d5f89a + 0d25a18 commit f9bca36
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
23 changes: 23 additions & 0 deletions epublib-core/build.sbt
@@ -0,0 +1,23 @@
scalaVersion := "2.10.1"

name := "epublib-core"

organization := "nl.siegmann.epublib"

version := "3.1"

publishMavenStyle := true

libraryDependencies += "net.sf.kxml" % "kxml2" % "2.3.0"

libraryDependencies += "xmlpull" % "xmlpull" % "1.1.3.4d_b4_min"

libraryDependencies += "org.slf4j" % "slf4j-api" % "1.6.1"

libraryDependencies += "org.slf4j" % "slf4j-simple" % "1.6.1"

libraryDependencies += "junit" % "junit" % "4.10"

libraryDependencies += "commons-io" % "commons-io" % "2.1"


Expand Up @@ -9,6 +9,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import org.apache.commons.io.IOUtils;

import nl.siegmann.epublib.Constants;
import nl.siegmann.epublib.service.MediatypeService;
import nl.siegmann.epublib.util.IOUtil;
Expand Down Expand Up @@ -112,7 +114,7 @@ public Resource(Reader in, String href) throws IOException {
* @param href The location of the resource within the epub. Example: "cover.jpg".
*/
public Resource(InputStream in, String href) throws IOException {
this(null, IOUtil.toByteArray(in), href, MediatypeService.determineMediaType(href));
this(null, IOUtils.toByteArray(in), href, MediatypeService.determineMediaType(href));
}

/**
Expand All @@ -136,6 +138,8 @@ public Resource(InputStream in, String fileName, int length, String href) throws
this.cachedSize = length;
}

/**
/**
* Creates a Lazy resource, by not actually loading the data for this entry.
*
Expand Down Expand Up @@ -229,6 +233,7 @@ public byte[] getData() throws IOException {
throw new IOException("Could not lazy-load data.");
} else {
this.data = readData;
this.data = IOUtils.toByteArray(in);
}

in.close();
Expand Down

0 comments on commit f9bca36

Please sign in to comment.