Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • org.joget.commons.util.FileStore
  • Under wflow-commons module
  • Utility class to retrieve plugin propertise value and i18n message to act as a temporary holder to manage the files posted in a HTTP request

Code Sample

Code Block
languagejava
import org.joget.commons.util.FileLimitException;
import org.joget.commons.util.FileStore;
import org.joget.commons.util.LogUtil;
import org.springframework.web.multipart.MultipartFile;


String uploadFieldName = "csvImport";
 
//Gets file
try {
    MultipartFile csvFile = FileStore.getFile(uploadFieldName);
} catch (FileLimitException e) {
    LogUtil.error("", e, "File received from " + uploadFieldName + " is exceeded file size limit of " + FileStore.getFileSizeLimit() + "MB.");
}

...

Method used by the system to clear the ThreadLocal object after a an HTTP request is finish finished processing

getFile
public static org.springframework.web.multipart.MultipartFile getFile(java.lang.String name) throws org.joget.commons.util.FileLimitException

...