Description

ลักษณะ

Code Sample

ตัวอย่างโค้ด

import java.io.File;
import org.joget.commons.util.FileManager

String path = "2dcd27eb-c0a80050-32ea05d3-608d46dd/test.txt";
 
//Get the file from temporary folder
File file = FileManager.getFileByPath(path);

Fields

ฟิลด์

THUMBNAIL_SIZE
public final static Integer THUMBNAIL_SIZE = 60; 
Default size used to generate thumbnail.

ขนาดเริ่มต้นที่ใช้ในการสร้างภาพขนาดย่อ

THUMBNAIL_EXT
public final static String THUMBNAIL_EXT = ".thumb.jpg"; 

File extension used for generated thumbnail.

นามสกุลไฟล์ที่ใช้สำหรับสร้างภาพย่อ

Methods

กระบวนการ

createThumbnail
public static void createThumbnail(java.lang.String path, java.lang.Integer thumbWidth, java.lang.Integer thumbHeight)

Generates a thumbnail of a image file in temporary files folder by relative path

สร้างรูปขนาดย่อของไฟล์ภาพในโฟลเดอร์ไฟล์ชั่วคราวโดยเส้นทางสัมพัทธ์

deleteFile
public static void deleteFile(java.io.File file)

Deletes a file

ลบไฟล์

deleteFileByPath
public static void deleteFileByPath(java.lang.String path)

Deletes the temporary file from temporary files folder by relative path

ลบไฟล์ชั่วคราวออกจากโฟลเดอร์ไฟล์ชั่วคราวด้วย path ที่เกี่ยวข้อง

getBaseDirectory
public static java.lang.String getBaseDirectory()

Gets directory path to temporary files folder

รับเส้นทางไดเรกทอรีไปยังโฟลเดอร์ไฟล์ชั่วคราว

getFileByPath
public static java.io.File getFileByPath(java.lang.String path)

Gets the temporary file from temporary files folder by relative path

รับไฟล์ชั่วคราวจากโฟลเดอร์ไฟล์ชั่วคราวโดย path

storeFile
public static java.lang.String storeFile(org.springframework.web.multipart.MultipartFile file)

Stores files post to the HTTP request to temporary files folder

จัดเก็บไฟล์ที่โพสต์ไปยังคำขอ HTTP ไปยังโฟลเดอร์ไฟล์ชั่วคราว