diff --git a/CHANGELOG.md b/CHANGELOG.md index afb2bbe..4faeea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.4.0 - 8 February 2025 + +- \#297 readLargeFile() now works on ACF + ## 4.3.1 - 29 January 2025 Fixes: diff --git a/ModuleConfig.cfc b/ModuleConfig.cfc index d804151..24e6ecd 100644 --- a/ModuleConfig.cfc +++ b/ModuleConfig.cfc @@ -4,7 +4,7 @@ component{ this.author = "Julian Halliwell"; this.webURL = "https://github.com/cfsimplicity/spreadsheet-cfml"; this.description = "CFML Spreadsheet Library"; - this.version = "4.3.1"; + this.version = "4.4.0"; this.autoMapModels = false; function configure(){ diff --git a/Spreadsheet.cfc b/Spreadsheet.cfc index 7a05101..24af418 100644 --- a/Spreadsheet.cfc +++ b/Spreadsheet.cfc @@ -1,7 +1,7 @@ component accessors="true"{ //"static" - property name="version" default="4.3.1" setter="false"; + property name="version" default="4.4.0" setter="false"; property name="osgiLibBundleVersion" default="5.4.0.0" setter="false"; //first 3 octets = POI version; increment 4th with other jar updates property name="osgiLibBundleSymbolicName" default="spreadsheet-cfml" setter="false"; property name="exceptionType" default="cfsimplicity.spreadsheet" setter="false"; @@ -1297,9 +1297,6 @@ component accessors="true"{ ,struct streamingReaderOptions ,boolean returnVisibleValues=false ){ - if( !this.getIsLucee() ){ - Throw( type=this.getExceptionType() & ".methodNotSupported", message="'readLargeFile()' is only supported on Lucee", detail="'readLargeFile()' currently only works with Lucee." ); - } getFileHelper().throwErrorIFfileNotExists( arguments.src ); getExceptionHelper().throwExceptionIFreadFormatIsInvalid( argumentCollection=arguments ); getSheetHelper().throwErrorIFSheetNameAndNumberArgumentsBothPassed( argumentCollection=arguments ); diff --git a/box.json b/box.json index 43a1f48..36ae20b 100644 --- a/box.json +++ b/box.json @@ -1,7 +1,7 @@ { "name" : "Spreadsheet CFML", "slug" : "spreadsheet-cfml", - "version" : "4.3.1", + "version" : "4.4.0", "shortDescription" : "CFML spreadsheet library", "author" : "Julian Halliwell", "location" : "forgeboxStorage", diff --git a/helpers/streamingReader.cfc b/helpers/streamingReader.cfc index 182eab0..38f9285 100644 --- a/helpers/streamingReader.cfc +++ b/helpers/streamingReader.cfc @@ -11,8 +11,14 @@ component extends="base"{ arguments.sheetToQueryArgs.workbook = getBuilder( arguments.builderOptions ).open( file ); return getSheetHelper().sheetToQuery( argumentCollection=arguments.sheetToQueryArgs ); } - catch( com.github.pjfanning.xlsx.exceptions.ReadException exception ){ - getExceptionHelper().throwInvalidFileForReadLargeFileException(); + catch( any exception ){ + /* + for some reason ACF won't match the exception type as a catch() arg here, i.e. + catch( com.github.pjfanning.xlsx.exceptions.ReadException exception ){} + */ + if( exception.type == "com.github.pjfanning.xlsx.exceptions.ReadException" ) + getExceptionHelper().throwInvalidFileForReadLargeFileException(); + rethrow; } finally{ getFileHelper().closeLocalFileOrStream( local, "file" ); diff --git a/test/specs/readLargeFile.cfm b/test/specs/readLargeFile.cfm index e71002e..488233b 100644 --- a/test/specs/readLargeFile.cfm +++ b/test/specs/readLargeFile.cfm @@ -1,7 +1,5 @@ -describe( - title="readLargeFile (Lucee only)" - ,body=function(){ +describe( "readLargeFile", function(){ it( "Can read an XLSX file into a query", function(){ var path = getTestFilePath( "large.xlsx" ); @@ -460,21 +458,5 @@ describe( }); } - ,skip=!s.getIsLucee() ); - -describe( - title="readLargeFile (when run on ACF)" - ,body=function(){ - - it( "throws a methodNotSupported exception", function(){ - expect( function(){ - var path = getTestFilePath( "large.xlsx" ); - s.readLargeFile( src=path ); - }).toThrow( type="cfsimplicity.spreadsheet.methodNotSupported" ); - }); - - } - ,skip=s.getIsLucee() -); \ No newline at end of file