-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bf7deb
commit 39b4160
Showing
5 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#Build Number for ANT. Do not edit! | ||
#Wed Feb 07 14:30:53 CET 2024 | ||
build.number=16 | ||
#Mon Jun 17 18:54:49 CEST 2024 | ||
build.number=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
source/java/src/org/lucee/extension/resource/s3/function/S3GetVersionInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.lucee.extension.resource.s3.function; | ||
|
||
import org.lucee.extension.resource.s3.S3; | ||
|
||
import lucee.loader.engine.CFMLEngine; | ||
import lucee.loader.engine.CFMLEngineFactory; | ||
import lucee.runtime.PageContext; | ||
import lucee.runtime.exp.PageException; | ||
import lucee.runtime.type.Query; | ||
import lucee.runtime.util.Cast; | ||
|
||
public class S3GetVersionInfo extends S3Function { | ||
|
||
private static final long serialVersionUID = 811465114006696746L; | ||
|
||
public static Query call(PageContext pc, String bucketName, String objectName, String accessKeyId, String secretAccessKey, String host, double timeout) throws PageException { | ||
CFMLEngine eng = CFMLEngineFactory.getInstance(); | ||
// for backward compatibility, when host was not existing | ||
if (eng.getDecisionUtil().isNumber(host)) { | ||
timeout = eng.getCastUtil().toDoubleValue(host); | ||
host = null; | ||
} | ||
try { | ||
// create S3 Instance | ||
S3 s3 = S3.getInstance(toS3Properties(pc, accessKeyId, secretAccessKey, host), toTimeout(timeout), pc.getConfig()); | ||
return s3.listVersions(bucketName, objectName); | ||
|
||
} | ||
catch (Exception e) { | ||
throw eng.getCastUtil().toPageException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public Object invoke(PageContext pc, Object[] args) throws PageException { | ||
CFMLEngine engine = CFMLEngineFactory.getInstance(); | ||
Cast cast = engine.getCastUtil(); | ||
|
||
if (args.length == 6) | ||
return call(pc, cast.toString(args[0]), cast.toString(args[1]), cast.toString(args[2]), cast.toString(args[3]), cast.toString(args[4]), cast.toDoubleValue(args[5])); | ||
if (args.length == 5) return call(pc, cast.toString(args[0]), cast.toString(args[1]), cast.toString(args[2]), cast.toString(args[3]), cast.toString(args[4]), 0); | ||
if (args.length == 4) return call(pc, cast.toString(args[0]), cast.toString(args[1]), cast.toString(args[2]), cast.toString(args[3]), null, 0); | ||
if (args.length == 3) return call(pc, cast.toString(args[0]), cast.toString(args[1]), cast.toString(args[2]), null, null, 0); | ||
if (args.length == 2) return call(pc, cast.toString(args[0]), cast.toString(args[1]), null, null, null, 0); | ||
if (args.length == 1) return call(pc, cast.toString(args[0]), null, null, null, null, 0); | ||
|
||
throw engine.getExceptionUtil().createFunctionException(pc, "S3GetVersionInfo", 1, 6, args.length); | ||
} | ||
} |