use of org.xwiki.stability.Unstable in project xwiki-platform by xwiki.
the class MailStorageScriptService method resendAsynchronously.
/**
* Resend the serialized MimeMessage asynchronously.
*
* @param batchId the name of the directory that contains serialized MimeMessage
* @param uniqueMessageId the unique id of the serialized MimeMessage
* @return the result and status of the send batch; null if an error occurred when getting the message from the
* store
* @since 9.3RC1
*/
@Unstable
public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) {
try {
MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId);
ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult);
return scriptMailResult;
} catch (MailStoreException e) {
// Save the exception for reporting through the script services's getLastError() API
setError(e);
return null;
}
}
use of org.xwiki.stability.Unstable in project xwiki-platform by xwiki.
the class LocalizationScriptService method getAvailableLocales.
/**
* @return the list of available locales for XWiki translations
* @since 9.7RC1
* @since 8.4.6
* @since 9.6.1
*/
@Unstable
public Set<Locale> getAvailableLocales() {
Set<Locale> locales = new HashSet<>();
locales.addAll(Arrays.asList(Locale.getAvailableLocales()));
try (InputStream resource = environment.getResourceAsStream("/WEB-INF/xwiki-locales.txt")) {
LineIterator iterator = IOUtils.lineIterator(resource, StandardCharsets.US_ASCII);
while (iterator.hasNext()) {
String line = iterator.nextLine();
if (StringUtils.isNotBlank(line)) {
locales.add(new Locale(line));
}
}
iterator.close();
} catch (Exception e) {
logger.warn("Exception while looking for XWiki Locales.", e);
}
return locales;
}
Aggregations