package.path = package.path .. ";/Users/rszwarc/Developer/Lua/LU/?.lua" package.path = package.path .. ";/Users/rszwarc/Developer/Lua/LU/Library/Lua/?.lua" package.cpath = package.cpath .. ";/Users/rszwarc/Developer/Lua/LU/Library/Modules/?.so" local LUFile = require( "LUFile" ) local LUList = require( "LUList" ) local LUString = require( "LUString" ) local MIME = require( "MIME" ) local string = require( "string" ) local aContent = LUFile( ".", "Test2.txt" ):content() local aMIME = MIME( aContent ) print( aMIME:type(), string.gsub( LUString:capitalize( aMIME:type() ), "[^%w]", "" ) ) print( aMIME:transferEncoding() ) print( aMIME:id() ) print( aMIME:description() ) print( aMIME:disposition() ) print( aMIME:headers():endIndex() ) print( aMIME:headers():keys() ) print( aMIME:headers():getValue( "received" ) ) --[[ local someKeys = aMIME:headers():keys() for anIndex, aKey in someKeys:iterator() do local aValue = aMIME:headers():get( aKey ) print( aKey, aValue ) end ]]-- local someHeaders = aMIME:headers():content() for anIndex, anHeader in someHeaders:iterator() do print( anHeader:key(), anHeader:value(), anHeader:parameters() ) end print( aMIME:content() ) print( aMIME:className() ) print( aMIME:type() ) local someParts = aMIME:content():content() print( someParts ) for anIndex, aPart in someParts:iterator() do print( aPart:type(), aPart:transferEncoding() ) print( aPart:headers():keys() ) print( "[" .. aPart:content() .. "]" ) end