X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static String toUnixPath(String path) {
public static String expandUserHome(String file) {
// replace any / with the proper separator (/ or \ for Linux and Windows respectively).
file = file.replaceAll("/", "\\"+File.separator); //The "\\" is to escape the separator if needed.
if (file.startsWith("~" + File.separator)) {
if (file.startsWith("~") && (file.length() == 1 || File.separator.equals(file.substring(1, 2)))) {
file = System.getProperty("user.home") + file.substring(1);
}
return file;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ void unixPathReturnedUnchanged(){
class ExpandUserHome {
String currUserHome = System.getProperty("user.home");
@Test
void minimalPath (){
String path="~";
assertEquals(currUserHome, FileDownloadUtils.expandUserHome(path));
}
@Test
void simplePath (){
String path="~/sequence.gb";
assertEquals(currUserHome+File.separator+"sequence.gb", FileDownloadUtils.expandUserHome(path));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@
*/
package org.biojava.nbio.phosphosite;

import org.biojava.nbio.structure.align.util.AtomCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.biojava.nbio.structure.align.util.AtomCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Phosphosite is available under the PhosphoSitePlus® is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License and is freely available for non-commercial purposes from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ private void pdb_ATOM_Handler(String line) {
startOfMolecule = false;


Character altLoc = new Character(line.substring (16, 17).charAt(0));
Character altLoc = line.substring (16, 17).charAt(0);
Group altGroup = null;


Expand Down Expand Up @@ -1931,7 +1931,7 @@ private void pdb_ATOM_Handler(String line) {



}
}


private Group getCorrectAltLocGroup( Character altLoc,
Expand Down
X Tutup