@@ -32,9 +32,9 @@ public class GXFile extends AbstractGXFile {
3232 private boolean ret ;
3333 private boolean isExternal = false ;
3434 private String uploadFileId ;
35-
35+
3636 public static ICleanupFile CleanUp ;
37-
37+
3838 public GXFile () {
3939 }
4040
@@ -51,7 +51,7 @@ public GXFile(String fileName, boolean isPrivate) {
5151 public GXFile (String fileName , ResourceAccessControlList fileAcl ) {
5252 this (fileName , fileAcl , GxFileInfoSourceType .Unknown );
5353 }
54-
54+
5555 public GXFile (String fileName , ResourceAccessControlList fileAcl , GxFileInfoSourceType sourceType ) {
5656 this ("" , fileName , fileAcl , sourceType );
5757 }
@@ -87,14 +87,9 @@ public GXFile(String baseDirectoryPath, String fileName, ResourceAccessControlLi
8787 }
8888
8989 private void createFileSourceLocal (String baseDirectoryPath , String fileName ) {
90- if (PrivateUtilities .isValidURL (fileName )){
91- String absoluteOrRelativePath = Paths .get (baseDirectoryPath , fileName .substring (fileName .lastIndexOf ("/" ) + 1 )).toString (); //BaseDirectory could be empty.
92- FileSource = new GXFileInfo (new File (absoluteOrRelativePath ));
93- } else {
94- boolean isAbsolutePath = PrivateUtilities .isAbsoluteFilePath (fileName );
95- String absoluteOrRelativePath = (isAbsolutePath ) ? fileName : Paths .get (baseDirectoryPath , fileName ).toString (); //BaseDirectory could be empty.
96- FileSource = new GXFileInfo (new File (absoluteOrRelativePath ));
97- }
90+ boolean isAbsolutePath = PrivateUtilities .isAbsoluteFilePath (fileName );
91+ String absoluteOrRelativePath = (isAbsolutePath )? fileName : Paths .get (baseDirectoryPath , fileName ).toString (); //BaseDirectory could be empty.
92+ FileSource = new GXFileInfo (new File (absoluteOrRelativePath ));
9893 }
9994
10095 public GXFile (IGXFileInfo fileInfo ) {
@@ -126,7 +121,7 @@ public void setFileInfo(IGXFileInfo fileInfo) {
126121
127122 public void setExternal (boolean isExternal ) {
128123 this .isExternal = isExternal ;
129- }
124+ }
130125
131126 public void setSource (String FileName ) {
132127 boolean isUpload = com .genexus .CommonUtil .isUploadPrefix (FileName );
@@ -187,7 +182,7 @@ public void create() {
187182 public boolean create (InputStream input ) {
188183 return create (input , false );
189184 }
190-
185+
191186 public boolean create (InputStream input , boolean overwrite ) {
192187 resetErrors ();
193188 try {
@@ -466,7 +461,7 @@ public Date getLastModified() {
466461 calendar .set (0 , 0 , 0 );
467462 return calendar .getTime ();
468463 }
469-
464+
470465 public InputStream getStream () {
471466 if (sourceSeted ()) {
472467 resetErrors ();
@@ -587,7 +582,7 @@ public String toBase64() {
587582 public Boolean fromBytes (byte [] data ) {
588583 if (FileSource == null ) {
589584 return false ;
590- }
585+ }
591586 try {
592587 FileSource .fromBytes (data );
593588 } catch (IOException e ) {
0 commit comments