Skip to content

Commit d1bffbf

Browse files
committed
Merge branch 'rc' into dev
2 parents 8d6f980 + 23cb7d4 commit d1bffbf

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# ignore these classes/packages when calculating object's size.
22
# edu.caltech.ipac.visualize.plot.PlotView
3-
java.io.BufferedInputStream

src/firefly/java/edu/caltech/ipac/firefly/server/util/multipart/MultiPartPostBuilder.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package edu.caltech.ipac.firefly.server.util.multipart;
55

66
import edu.caltech.ipac.firefly.data.Param;
7+
import edu.caltech.ipac.firefly.server.ServerContext;
78
import edu.caltech.ipac.firefly.server.network.HttpServices;
89
import edu.caltech.ipac.firefly.server.util.Logger;
910
import edu.caltech.ipac.util.StringUtils;
@@ -22,10 +23,12 @@
2223
import java.io.IOException;
2324
import java.io.InputStream;
2425
import java.io.OutputStream;
26+
import java.net.HttpURLConnection;
2527
import java.net.MalformedURLException;
2628
import java.net.URL;
2729
import java.util.ArrayList;
2830
import java.util.List;
31+
import java.util.Map;
2932

3033
/**
3134
* Date: Jul 27, 2010
@@ -42,6 +45,7 @@ public class MultiPartPostBuilder {
4245
private List<Param> headers = new ArrayList<Param>();
4346
private String userId;
4447
private String passwd;
48+
private Map<String, String> cookies;
4549

4650
public MultiPartPostBuilder() {}
4751

@@ -75,6 +79,11 @@ public void addHeader(String name, String value) {
7579
headers.add(new Param(name,value));
7680
}
7781

82+
83+
public void setCookie(Map<String, String> Cookies) {
84+
cookies = Cookies;
85+
}
86+
7887
public void addFile(String name, File file) {
7988
try {
8089
parts.add(new FilePart(name, file));
@@ -102,6 +111,7 @@ public MultiPartRespnse post(OutputStream responseBody) {
102111

103112
for(Param p : headers) {
104113
filePost.addRequestHeader(p.getName(), p.getValue());
114+
105115
}
106116

107117
try {
@@ -111,7 +121,11 @@ public MultiPartRespnse post(OutputStream responseBody) {
111121
filePost.getParams())
112122
);
113123

114-
HttpServices.executeMethod(filePost, userId, passwd);
124+
if (cookies != null) {
125+
HttpServices.executeMethod(filePost,userId,passwd,cookies);
126+
} else {
127+
HttpServices.executeMethod(filePost, userId, passwd);
128+
}
115129

116130
MultiPartRespnse resp = new MultiPartRespnse(filePost.getResponseHeaders(),
117131
filePost.getStatusCode(),

src/firefly/java/edu/caltech/ipac/firefly/visualize/FootprintFactory.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ public enum INSTRUMENTS {
122122
"POLYGON 360.00175833 -0.02767222 359.97505000 -0.00110278 359.99865556 0.02345556 360.02604444 -0.00377500 360.00175833 -0.02767222 "),
123123

124124
// Spitzer IRAC3.6/5.8um; FOV data are from SPOT Spitzer focal plane overlay SPOT when the telescope center is at (0, 0):
125-
IRAC36(FOOTPRINT.SPITZER,
125+
IRAC36("IRAC 3.6 micron", FOOTPRINT.SPITZER,
126126
"POLYGON 359.98239 -0.00474 359.89576 -0.00408 359.89513 -0.09074 359.98176 -0.09140 "),
127127

128128
// Spitzer IRAC4.5/8.0um; FOV data are from Spitzer focal plane overlay in SPOT when the telescope center is at (0, 0):
129-
IRAC45(FOOTPRINT.SPITZER,
129+
IRAC45("IRAC 4.5 micron", FOOTPRINT.SPITZER,
130130
"POLYGON 0.09444 -0.00272 0.00778 -0.00215 0.00725 -0.08881 0.09393 -0.08938 ") ;
131131

132132
private String stc;
@@ -139,10 +139,11 @@ public enum INSTRUMENTS {
139139
this.label = this.name();
140140
}
141141

142-
INSTRUMENTS(String prefix, FOOTPRINT fp, String stcDef) {
142+
INSTRUMENTS(String label, FOOTPRINT fp, String stcDef) {
143143
this.stc = stcDef;
144144
this.mission = fp;
145-
this.label = prefix+this.name();
145+
// Label is a prefix if contains '/' (HST)
146+
this.label = label.trim() + (label.trim().endsWith("/") ? this.name() : "");
146147
}
147148
public String getStc() {
148149
return this.stc;

0 commit comments

Comments
 (0)