Skip to content
Open
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
Binary file added .vs/CommunityCommons/v17/.wsuo
Binary file not shown.
67 changes: 67 additions & 0 deletions .vs/CommunityCommons/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\NowakM1\\source\\repos\\CommunityCommons\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 1,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedHeight": 206,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
}
]
},
{
"DockedHeight": 206,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{a80febb4-e7e0-4147-b476-21aaf2453969}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{004be353-6879-467c-9d1e-9ac23cdf6d49}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
}
]
},
{
"DockedHeight": 117,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{e1b7d1f8-9b3c-49b1-8f4f-bfc63a88835d}"
}
]
}
]
}
]
}
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
Binary file modified src/CommunityCommons/CommunityCommons.mpr
Binary file not shown.
173 changes: 110 additions & 63 deletions src/CommunityCommons/javasource/communitycommons/StringUtils.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,31 @@
import com.mendix.systemwideinterfaces.core.UserAction;

/**
* Reads the contents form the provided file document, using the specified encoding, and returns it as string.
* Reads the contents form the provided file document, using the specified
* encoding, and returns it as string.
*/
public class StringFromFile extends UserAction<java.lang.String>
{
public class StringFromFile extends UserAction<java.lang.String> {
/** @deprecated use source.getMendixObject() instead. */
@java.lang.Deprecated(forRemoval = true)
private final IMendixObject __source;
private final system.proxies.FileDocument source;
private final communitycommons.proxies.StandardEncodings encoding;

public StringFromFile(
IContext context,
IMendixObject _source,
java.lang.String _encoding
)
{
public StringFromFile(IContext context, IMendixObject _source, java.lang.String _encoding) {
super(context);
this.__source = _source;
this.source = _source == null ? null : system.proxies.FileDocument.initialize(getContext(), _source);
this.encoding = _encoding == null ? null : communitycommons.proxies.StandardEncodings.valueOf(_encoding);
}

@java.lang.Override
public java.lang.String executeAction() throws Exception
{
public java.lang.String executeAction() throws Exception {
// BEGIN USER CODE

if (this.encoding == communitycommons.proxies.StandardEncodings.UTF_8_BOM) {
return StringUtils.stringFromFileUtf8Bom(getContext(), source);
}

Charset charset = StandardCharsets.UTF_8;
if (this.encoding != null)
charset = Charset.forName(this.encoding.name().replace('_', '-'));
Expand All @@ -52,11 +51,11 @@ public java.lang.String executeAction() throws Exception

/**
* Returns a string representation of this action
*
* @return a string representation of this action
*/
@java.lang.Override
public java.lang.String toString()
{
public java.lang.String toString() {
return "StringFromFile";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public StringToFile(
public java.lang.Boolean executeAction() throws Exception
{
// BEGIN USER CODE

if (this.encoding == communitycommons.proxies.StandardEncodings.UTF_8_BOM) {
StringUtils.stringToFileUtf8Bom(getContext(), value, destination);
return true;
}

Charset charset = StandardCharsets.UTF_8;
if (this.encoding != null)
charset = Charset.forName(this.encoding.name().replace('_', '-'));
Expand Down