[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[jx8-android] 083 - assets



"Accessing assets files"
| licenses fName contents |
licenses := JX8 applicationAssets keys select: [:each| each asLowercase includes: #license ].
licenses isEmpty ifTrue: [ ^self error: 'No license files found in application assets' ].
fName := licenses first.
contents := (NodeJS fs
	readFileSync: fName)
	toString: #utf8.
contents size = 0 ifTrue: [ ^self error: 'Empty contents' ].
self print: 'From file ',fName.
self print: (contents stream nextLine upTo: $:).
self print: 'Ok - File ',fName,' contents size=',contents size.