Skip to content

Commit

Permalink
Merge pull request #5 from JamzTheMan/1.4.1-dev-branch
Browse files Browse the repository at this point in the history
Feature Enhancements to support Campaign Exports
  • Loading branch information
cwisniew authored Jun 14, 2016
2 parents ec3ec91 + f377551 commit 13112f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ configurations {


task wrapper(type: Wrapper) {
gradleVersion='2.1'
gradleVersion='2.12'
}

install {
Expand Down Expand Up @@ -88,7 +88,7 @@ buildscript {
dependencies {
compile 'antlr:antlr:2.7.6'
compile 'commons-io:commons-io:2.4'
compile 'com.thoughtworks.xstream:xstream:1.4.1'
compile 'com.thoughtworks.xstream:xstream:1.4.9'
compile 'commons-lang:commons-lang:2.6'
compile 'commons-logging:commons-logging:1.1.1'
compile 'commons-net:commons-net:3.2'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Sep 17 23:43:06 ACST 2015
#Mon Jun 13 17:10:57 CDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip
20 changes: 2 additions & 18 deletions src/main/java/net/rptools/lib/io/PackedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public Object getContent(ModelVersionManager versionManager, String fileVersion)
r = getFileAsReader(CONTENT_FILE);
String xml = IOUtils.toString(r);
xml = versionManager.transform(xml, fileVersion);
xstream.ignoreUnknownElements(); // Jamz: Should we use this? This will ignore new classes/fields added.
return xstream.fromXML(xml);
} else {
return getFileObject(CONTENT_FILE);
Expand Down Expand Up @@ -406,10 +407,6 @@ public void setContent(Object content) throws IOException {
putFile(CONTENT_FILE, content);
}

public void setContent(Object content, Class omittedClass, String omittedField) throws IOException {
putFileWithOmissions(CONTENT_FILE, content, omittedClass, omittedField);
}

/**
* Does the work of preparing for output to a temporary file, returning the {@link File} object associated with the
* temporary location. The caller is then expected to open and write their data to the file which will later be
Expand Down Expand Up @@ -494,20 +491,6 @@ public void putFile(String path, Object obj) throws IOException {
IOUtils.closeQuietly(bw);
}

// This method can remove a Class.field for backwards compatibility, i.e. LightSource.lumens for b89 compatibility
public void putFileWithOmissions(String path, Object obj, Class omittedClass, String omittedField) throws IOException {
File explodedFile = putFileImpl(path);
FileOutputStream fos = new FileOutputStream(explodedFile);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
BufferedWriter bw = new BufferedWriter(osw);

xstream.omitField(omittedClass, omittedField);
xstream.toXML(obj, bw);

bw.newLine(); // Not necessary but editing the file looks nicer. ;-)
IOUtils.closeQuietly(bw);
}

/**
* Write the data from the given URL to the path in the ZIP file; as the data is presumed binary there is no
* {@link Charset} conversion.
Expand Down Expand Up @@ -572,6 +555,7 @@ public Object getFileObject(String path) throws IOException {
LineNumberReader r = getFileAsReader(path);
Object o = null;
try {
xstream.ignoreUnknownElements(); // Jamz: Should we use this? This will ignore new classes/fields added.
o = xstream.fromXML(r);
} catch (InstantiationError ie) {
log.error("Found at line number " + r.getLineNumber());
Expand Down

0 comments on commit 13112f7

Please sign in to comment.