Skip to content

Commit

Permalink
Changed the Mypic file-upload code to account for the xspupload dir
Browse files Browse the repository at this point in the history
property being null, which is apparently the case when it hasn't been
explicitly overriden
  • Loading branch information
jesse-gallagher committed Dec 19, 2012
1 parent 6f8e3f0 commit 26052a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 4 additions & 1 deletion disk-collaborationtoday/Code/Java/com/ZetaOne/mypic/Api.java
Expand Up @@ -465,6 +465,9 @@ public String retrieveImage() {

// Don't assume that xspupload is in the data directory
String xspupload = ExtLibUtil.getStringProperty(ExtLibUtil.getXspContext(), "xsp.persistence.dir.xspupload");
if(xspupload == null) {
xspupload = ".";
}

File outputfile = new File(xspupload + File.separator + fileName);
ImageIO.write(dst, "png", outputfile);
Expand All @@ -491,7 +494,7 @@ public String retrieveImage() {
rtItem.embedObject(
EmbeddedObject.EMBED_ATTACHMENT,
"",
xspupload + File.separator + fileName,
outputfile.getAbsolutePath(),
""
);
rtItem.compact();
Expand Down
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="3.0" replicaid="85257AA6004F5595" version="8.5" xmlns="http://www.lotus.com/dxl">
<noteinfo noteid="4d2" sequence="1" unid="F351973A81CB665F85257AB6007CE1C2">
<created><datetime>20121114T174402,58-05</datetime></created>
<modified><datetime>20121114T174402,80-05</datetime></modified>
<revised><datetime>20121114T174402,78-05</datetime></revised>
<lastaccessed><datetime>20121114T174402,78-05</datetime></lastaccessed>
<addedtofile><datetime>20121114T174402,78-05</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Jesse Gallagher/O=Frost</name><name>CN=Jesse Gallagher/O=MTC</name><name>CN=Jesse Gallagher/O=Frost</name></updatedby>
<wassignedby><name>CN=Jesse Gallagher/O=MTC</name></wassignedby>
<?xml version="1.0" encoding="UTF-8"?><note class="form" replicaid="85257AD1004C558E" version="9.0" xmlns="http://www.lotus.com/dxl">
<noteinfo noteid="39a" sequence="12" unid="2EB34D92F17F222C85257AD1004C5CF1">
<created><datetime>20121211T085405,29-05</datetime></created>
<modified><datetime>20121219T172242,56-05</datetime></modified>
<revised><datetime>20121219T172242,54-05</datetime></revised>
<lastaccessed><datetime>20121219T172242,54-05</datetime></lastaccessed>
<addedtofile><datetime>20121211T085405,30-05</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Jesse Gallagher/O=Frost</name></updatedby>
<wassignedby><name>CN=Jesse Gallagher/O=Frost</name></wassignedby>
<item name="$Flags"><text>34567Cg~[</text></item>
<item name="$TITLE"><text>com/ZetaOne/mypic/Api.java</text></item>

Expand Down
Expand Up @@ -60,6 +60,6 @@
<renderer-class>com.ZetaOne.mypic.MypicCardRenderer</renderer-class>
</renderer>
</render-kit>
<!--AUTOGEN-START-BUILDER: Automatically generated by IBM Lotus Domino Designer. Do not modify.-->
<!--AUTOGEN-START-BUILDER: Automatically generated by IBM Domino Designer. Do not modify.-->
<!--AUTOGEN-END-BUILDER: End of automatically generated section-->
</faces-config>

0 comments on commit 26052a0

Please sign in to comment.