Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Jun 12, 2020
1 parent f9690c6 commit 1aedd43
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/broad/igv/sam/AlignmentDataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private boolean intervalInView(AlignmentInterval interval) {


AlignmentInterval loadInterval(String chr, int start, int end, AlignmentTrack.RenderOptions renderOptions) {
System.out.println("Load interval");

String sequence = chrMappings.containsKey(chr) ? chrMappings.get(chr) : chr;

DownsampleOptions downsampleOptions = new DownsampleOptions();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/broad/igv/ui/IGV.java
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ public class StartupRunnable implements Runnable {
public void run() {
final boolean runningBatch = igvArgs.getBatchFile() != null;
BatchRunner.setIsBatchMode(runningBatch);

UIUtilities.invokeOnEventThread(() -> mainFrame.setIconImage(getIconImage()));
if (Globals.IS_MAC) {
setAppleDockIcon();
Expand Down
70 changes: 0 additions & 70 deletions src/main/java/org/broad/igv/util/HttpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,76 +571,6 @@ public void actionPerformed(ActionEvent e) {
}


public void uploadGenomeSpaceFile(String uri, File file, Map<String, String> headers) throws IOException {

HttpURLConnection urlconnection = null;
OutputStream bos = null;

URL url = HttpUtils.createURL(uri);
urlconnection = openConnection(url, headers, "PUT");
urlconnection.setDoOutput(true);
urlconnection.setDoInput(true);

bos = new BufferedOutputStream(urlconnection.getOutputStream());
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
int i;
// read byte by byte until end of stream
while ((i = bis.read()) > 0) {
bos.write(i);
}
bos.close();
int responseCode = urlconnection.getResponseCode();

// Error messages below.
if (responseCode >= 400) {
String message = readErrorStream(urlconnection);
throw new IOException("Error uploading " + file.getName() + " : " + message);
}
}


public String createGenomeSpaceDirectory(URL url, String body) throws IOException {

HttpURLConnection urlconnection = null;
OutputStream bos = null;

Map<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
headers.put("Content-Length", String.valueOf(body.getBytes().length));

urlconnection = openConnection(url, headers, "PUT");
urlconnection.setDoOutput(true);
urlconnection.setDoInput(true);

bos = new BufferedOutputStream(urlconnection.getOutputStream());
bos.write(body.getBytes());
bos.close();
int responseCode = urlconnection.getResponseCode();

// Error messages below.
StringBuffer buf = new StringBuffer();
InputStream inputStream;

if (responseCode >= 200 && responseCode < 300) {
inputStream = urlconnection.getInputStream();
} else {
inputStream = urlconnection.getErrorStream();
}
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
String nextLine;
while ((nextLine = br.readLine()) != null) {
buf.append(nextLine);
buf.append('\n');
}
inputStream.close();

if (responseCode >= 200 && responseCode < 300) {
return buf.toString();
} else {
throw new IOException("Error creating GS directory: " + buf.toString());
}
}

/**
* Code for disabling SSL certification
*/
Expand Down

0 comments on commit 1aedd43

Please sign in to comment.