Versions Compared

Key

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

Table of Contents

Description

Thai

ลักษณะ

  • org.joget.commons.util.FileManager
  • Under wflow-commons module
  • Utility methods used by the system to manage temporary files

Code Sample

Thai

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

Code Block
languagejava
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

Thai

ฟิลด์

THUMBNAIL_SIZE
public final static Integer THUMBNAIL_SIZE = 60; 

Default size used to generate thumbnail.

Thai

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

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

File extension used for generated thumbnail.

Thai

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

Methods

Thai

กระบวนการ

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

Thai

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

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

Deletes a file

Thai

ลบไฟล์

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

Deletes the temporary file from temporary files folder by relative path

Thai

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

getBaseDirectory
public static java.lang.String getBaseDirectory()

Gets directory path to temporary files folder

Thai

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

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

Gets the temporary file from temporary files folder by relative path

Thai

รับไฟล์ชั่วคราวจากโฟลเดอร์ไฟล์ชั่วคราวโดย 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

...

Thai

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