hrugani
hrugani

Reputation: 477

How to get an Absolute URI of a file that exists in codenameone FileSystemStorage?

How to get an Absolute URI of a file that exists in codenameone FileSystemStorage?

In my project, I need to send a file that exists in CodeNameOne FileSystemStorage as an email attachment. I am using Message - getAttachments().put(...) method that forces me to use an uri (as string) of this file as a parameter.

How can I get this URI. Or better, How can I send a file in FileSistemStorage as an email attachment?

Upvotes: 1

Views: 110

Answers (1)

James H
James H

Reputation: 1116

This is pretty easy, use FileSystemStorage.getAppHomePath(), and append your filename to the string it returns.

More here : https://www.codenameone.com/javadoc/index.html

Upvotes: 1

Related Questions