Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions android/src/main/java/com/genexus/db/ForEachCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ public void setString(int index, String value, int length) throws SQLException {
public void setString(int index, String value) throws SQLException {}
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException {}
public void setGXDbFileURI(int index, String fileName, String blobPath, int length) throws SQLException {}
public void setBytes(int index, byte value[]) throws SQLException {}
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName, boolean downloadContent) throws SQLException {}
public void setBytes(int index, byte value[]) throws SQLException {}
public void setDateTime(int index, java.util.Date value, boolean onlyTime) throws SQLException {}
public void setDateTime(int index, java.util.Date value, boolean onlyTime, boolean hasmilliseconds) throws SQLException {}
public void setDateTime(int index, java.util.Date value, boolean onlyTime, boolean onlyDate, boolean hasmilliseconds) throws SQLException {}
Expand All @@ -215,8 +216,9 @@ public void setTime(int index, java.sql.Time value) throws SQLException {}
public void setTimestamp(int index, java.sql.Timestamp value) throws SQLException {}
public void setBLOBFile(int index, String fileName) throws SQLException {}
public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException {}

public void setVarchar(int index, String value, int length, boolean allowsNull) throws SQLException {}
public void setBLOBFile(int index, String fileName, boolean isMultiMedia, boolean downloadContent) throws SQLException {}

public void setVarchar(int index, String value, int length, boolean allowsNull) throws SQLException {}
public void setLongVarchar(int index, String value, boolean allowsNull) throws SQLException {}
public void setNLongVarchar(int index, String value, boolean allowsNull) throws SQLException {}
public void setLongVarchar(int index, String value, int maxLength, boolean allowsNull) throws SQLException {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,15 @@ public void setString(int index, String value) throws SQLException

public void setGXDbFileURI(int index, String fileName, String blobPath, int length) throws SQLException
{
setGXDbFileURI(index, fileName, blobPath, length, null, null);
setGXDbFileURI(index, fileName, blobPath, length, null, null, false);
}

public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException
{
setGXDbFileURI(index, fileName, blobPath, length, null, null, false);
}

public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName, boolean downloadContent) throws SQLException
{
if (blobPath.trim().length() == 0)
setVarchar(index, fileName, length, false);
Expand Down Expand Up @@ -799,7 +804,9 @@ public void setGXDbFileURI(int index, String fileName, String blobPath, int leng
}
}

if (isLocalFile)
if (isLocalFile
|| (downloadContent && (blobPath.toLowerCase().startsWith("http://") || blobPath.toLowerCase().startsWith("https://")) )
)
{
// Local path in sdcard.
//fileNameNew = blobBasePath + "/" + GXutil.getFileName(fileName)+ "." + GXutil.getFileType(fileName);
Expand Down Expand Up @@ -1113,10 +1120,15 @@ public void setBLOBFile(java.sql.Blob blob, String fileName) throws SQLException

public void setBLOBFile(int index, String fileName) throws SQLException
{
setBLOBFile(index, fileName, false);
setBLOBFile(index, fileName, false, false);
}

public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException
{
setBLOBFile(index, fileName, isMultiMedia, false);
}

public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException
public void setBLOBFile(int index, String fileName, boolean isMultiMedia, boolean downloadContent) throws SQLException
{
if(skipSetBlobs)
{
Expand Down Expand Up @@ -1174,10 +1186,11 @@ else if(blobFiles.length < index)
// add token if necesary?
//Boolean addToken = (fileName.compareTo(GXDbFile.removeTokenFromFileName(fileName)) == 0);

if (fileName.toLowerCase().startsWith("http") && isLocalFile)
if ( (fileName.toLowerCase().startsWith("http://") || fileName.toLowerCase().startsWith("https://"))
&& isLocalFile || downloadContent)
{
URL fileURL = new URL(fileName);

//fileNameNew = GXDbFile.generateUri(fileName, addToken);
fileNameNew = blobBasePath + "/" + CommonUtil.getFileName(fileName)+ "." + CommonUtil.getFileType(fileName);
//fileName = com.genexus.PrivateUtilities.getTempFileName(blobPath, GXutil.getFileName(fileName), GXutil.getFileType(fileName));
Expand Down
6 changes: 4 additions & 2 deletions common/src/main/java/com/genexus/db/IFieldSetter.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public interface IFieldSetter
public void setLongVarchar(int index, String value, int maxLength) throws SQLException;
public void setString(int index, String value, int length) throws SQLException;
public void setString(int index, String value) throws SQLException;
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException;
public void setGXDbFileURI(int index, String fileName, String blobPath, int length) throws SQLException;
public void setBytes(int index, byte value[]) throws SQLException;
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException;
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName, boolean downloadContent) throws SQLException;
public void setBytes(int index, byte value[]) throws SQLException;
public void setDateTime(int index, java.util.Date value, boolean onlyTime) throws SQLException;
public void setDateTime(int index, java.util.Date value, boolean onlyTime, boolean hasmilliseconds) throws SQLException;
public void setDateTime(int index, java.util.Date value, boolean onlyTime, boolean onlyDate, boolean hasmilliseconds) throws SQLException;
Expand All @@ -33,6 +34,7 @@ public interface IFieldSetter
public void setTimestamp(int index, java.sql.Timestamp value) throws SQLException;
public void setBLOBFile(int index, String fileName) throws SQLException;
public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException;
public void setBLOBFile(int index, String fileName, boolean isMultiMedia, boolean downloadContent) throws SQLException;

public void setVarchar(int index, String value, int length, boolean allowsNull) throws SQLException;
public void setLongVarchar(int index, String value, boolean allowsNull) throws SQLException;
Expand Down
8 changes: 5 additions & 3 deletions java/src/main/java/com/genexus/db/ForEachCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ public void setString(int index, String value, int length) throws SQLException {
public void setString(int index, String value) throws SQLException {}
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException {}
public void setGXDbFileURI(int index, String fileName, String blobPath, int length) throws SQLException {}
public void setBytes(int index, byte value[]) throws SQLException {}
public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName, boolean downloadContent) throws SQLException {}
public void setBytes(int index, byte value[]) throws SQLException {}

public void setDateTime(int index, java.util.Date value, boolean onlyTime) throws SQLException {}
public void setDateTime(int index, java.util.Date value, boolean onlyTime, boolean hasmilliseconds) throws SQLException{}
Expand All @@ -325,8 +326,9 @@ public void setTime(int index, java.sql.Time value) throws SQLException {}
public void setTimestamp(int index, java.sql.Timestamp value) throws SQLException {}
public void setBLOBFile(int index, String fileName) throws SQLException {}
public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException {}

public void setVarchar(int index, String value, int length, boolean allowsNull) throws SQLException {}
public void setBLOBFile(int index, String fileName, boolean isMultiMedia, boolean downloadContet) throws SQLException {}

public void setVarchar(int index, String value, int length, boolean allowsNull) throws SQLException {}
public void setLongVarchar(int index, String value, boolean allowsNull) throws SQLException {}
public void setNLongVarchar(int index, String value, boolean allowsNull) throws SQLException {}
public void setLongVarchar(int index, String value, int maxLength, boolean allowsNull) throws SQLException {}
Expand Down
11 changes: 11 additions & 0 deletions java/src/main/java/com/genexus/db/driver/GXPreparedStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,12 @@ public void setGXDbFileURI(int index, String fileName, String blobPath, int leng
{
setGXDbFileURI(index, fileName, blobPath, length, null, null);
}

public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName, boolean downloadContent) throws SQLException
{
setGXDbFileURI(index, fileName, blobPath, length, tableName, fieldName);
}

public void setGXDbFileURI(int index, String fileName, String blobPath, int length, String tableName, String fieldName) throws SQLException
{

Expand Down Expand Up @@ -1349,6 +1355,11 @@ public void setBLOBFile(int index, String fileName) throws SQLException
setBLOBFile(index, fileName, false);
}

public void setBLOBFile(int index, String fileName, boolean isMultiMedia, boolean downloadContent) throws SQLException
{
setBLOBFile(index, fileName, isMultiMedia);
}

public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException
{
if (isMultiMedia && Application.getGXServices().get(GXServices.STORAGE_SERVICE) != null)
Expand Down