Skip to content

Commit d2c920b

Browse files
authored
When using External Provider, absolute excel Files must be created localy. (#510)
Issue: 93035
1 parent 89afa87 commit d2c920b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

gxoffice/src/main/java/com/genexus/gxoffice/poi/hssf/ExcelDocument.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public short Open(String fileName)
5050
}
5151
else
5252
{
53-
GXFile file = new GXFile(fileName);
53+
boolean isAbsolute = new java.io.File(fileName).isAbsolute();
54+
GXFile file = new GXFile(fileName, Constants.EXTERNAL_UPLOAD_ACL, isAbsolute);
5455
if (file.exists()) {
5556
//System.out.println("Opening..");
5657
POIFSFileSystem poifs = new POIFSFileSystem(file.getStream());
@@ -90,7 +91,8 @@ public short Save()
9091
workBook.write(fs);
9192
ByteArrayInputStream in = new ByteArrayInputStream(fs.toByteArray());
9293
fs.close();
93-
GXFile file = new GXFile(xlsFileName, Constants.EXTERNAL_UPLOAD_ACL);
94+
boolean isAbsolute = new java.io.File(xlsFileName).isAbsolute();
95+
GXFile file = new GXFile(xlsFileName, Constants.EXTERNAL_UPLOAD_ACL, isAbsolute);
9496
file.create(in, true);
9597
}
9698
catch(Exception e)

gxoffice/src/main/java/com/genexus/gxoffice/poi/sxssf/ExcelDocument.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
44
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
55

6+
import com.genexus.gxoffice.Constants;
67
import com.genexus.gxoffice.IExcelCells;
78
import com.genexus.gxoffice.IGxError;
89
import com.genexus.gxoffice.poi.xssf.StylesCache;
@@ -27,7 +28,8 @@ public short Open(String fileName) {
2728
return errCod;
2829
}
2930
} else {
30-
GXFile file = new GXFile(fileName);
31+
boolean isAbsolute = new java.io.File(fileName).isAbsolute();
32+
GXFile file = new GXFile(fileName, Constants.EXTERNAL_UPLOAD_ACL, isAbsolute);
3133
if (file.exists()) {
3234
// System.out.println("Opening..");
3335
workBook = new SXSSFWorkbook(new XSSFWorkbook(file.getStream()));

gxoffice/src/main/java/com/genexus/gxoffice/poi/xssf/ExcelDocument.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public short Open(String fileName) {
3636
return errCod;
3737
}
3838
} else {
39-
GXFile file = new GXFile(fileName, Constants.EXTERNAL_UPLOAD_ACL);
39+
boolean isAbsolute = new java.io.File(fileName).isAbsolute();
40+
GXFile file = new GXFile(fileName, Constants.EXTERNAL_UPLOAD_ACL, isAbsolute);
4041
if (file.exists()) {
4142
// System.out.println("Opening..");
4243
workBook = new XSSFWorkbook(file.getStream());
@@ -74,7 +75,8 @@ public short Save() {
7475
workBook.write(fs);
7576
ByteArrayInputStream in = new ByteArrayInputStream(fs.toByteArray());
7677
fs.close();
77-
GXFile file = new GXFile(xlsFileName, Constants.EXTERNAL_UPLOAD_ACL);
78+
boolean isAbsolute = new java.io.File(xlsFileName).isAbsolute();
79+
GXFile file = new GXFile(xlsFileName, Constants.EXTERNAL_UPLOAD_ACL, isAbsolute);
7880
file.create(in, true);
7981
saved = true;
8082
} catch (Exception e) {

0 commit comments

Comments
 (0)