File tree Expand file tree Collapse file tree 4 files changed +17
-10
lines changed
main/java/org/biojava/nbio/core/util
test/java/org/biojava/nbio/core/util
biojava-modfinder/src/main/java/org/biojava/nbio/phosphosite
biojava-structure/src/main/java/org/biojava/nbio/structure/io Expand file tree Collapse file tree 4 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ public static String toUnixPath(String path) {
200200 public static String expandUserHome (String file ) {
201201 // replace any / with the proper separator (/ or \ for Linux and Windows respectively).
202202 file = file .replaceAll ("/" , "\\ " +File .separator ); //The "\\" is to escape the separator if needed.
203- if (file .startsWith ("~" + File .separator )) {
203+ if (file .startsWith ("~" ) && ( file . length () == 1 || File .separator . equals ( file . substring ( 1 , 2 )) )) {
204204 file = System .getProperty ("user.home" ) + file .substring (1 );
205205 }
206206 return file ;
Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ void unixPathReturnedUnchanged(){
131131 class ExpandUserHome {
132132 String currUserHome = System .getProperty ("user.home" );
133133 @ Test
134+ void minimalPath (){
135+ String path ="~" ;
136+ assertEquals (currUserHome , FileDownloadUtils .expandUserHome (path ));
137+ }
138+ @ Test
134139 void simplePath (){
135140 String path ="~/sequence.gb" ;
136141 assertEquals (currUserHome +File .separator +"sequence.gb" , FileDownloadUtils .expandUserHome (path ));
Original file line number Diff line number Diff line change 2020 */
2121package org .biojava .nbio .phosphosite ;
2222
23- import org . biojava . nbio . structure . align . util . AtomCache ;
24- import org . slf4j . Logger ;
25- import org . slf4j . LoggerFactory ;
26-
27- import java .io .* ;
23+ import java . io . BufferedInputStream ;
24+ import java . io . File ;
25+ import java . io . FileOutputStream ;
26+ import java . io . IOException ;
27+ import java .io .InputStream ;
2828import java .net .URL ;
2929import java .nio .file .Files ;
3030import java .nio .file .StandardCopyOption ;
31- import java .util .ArrayList ;
3231import java .util .Arrays ;
3332import java .util .List ;
3433import java .util .stream .Collectors ;
35- import java .util .stream .Stream ;
34+
35+ import org .biojava .nbio .structure .align .util .AtomCache ;
36+ import org .slf4j .Logger ;
37+ import org .slf4j .LoggerFactory ;
3638
3739/**
3840 * 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
Original file line number Diff line number Diff line change @@ -1726,7 +1726,7 @@ private void pdb_ATOM_Handler(String line) {
17261726 startOfMolecule = false ;
17271727
17281728
1729- Character altLoc = new Character ( line .substring (16 , 17 ).charAt (0 ) );
1729+ Character altLoc = line .substring (16 , 17 ).charAt (0 );
17301730 Group altGroup = null ;
17311731
17321732
@@ -1931,7 +1931,7 @@ private void pdb_ATOM_Handler(String line) {
19311931
19321932
19331933
1934- }
1934+ }
19351935
19361936
19371937 private Group getCorrectAltLocGroup ( Character altLoc ,
You can’t perform that action at this time.
0 commit comments