浏览代码

add documentation

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 年之前
父节点
当前提交
63e7c298ca
共有 1 个文件被更改,包括 18 次插入0 次删除
  1. 18 0
      app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt

+ 18 - 0
app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt

@@ -24,6 +24,15 @@ object FileNameValidator {
         "LPT¹", "LPT²", "LPT³"
     )
 
+    /**
+     * Checks the validity of a file name.
+     *
+     * @param filename The name of the file to validate.
+     * @param capability The capabilities affecting the validation criteria such as forbiddenFilenames, forbiddenCharacters.
+     * @param context The context used for retrieving error messages.
+     * @param existedFileNames Set of existing file names to avoid duplicates.
+     * @return An error message if the filename is invalid, null otherwise.
+     */
     @Suppress("ReturnCount")
     fun checkFileName(
         filename: String,
@@ -63,6 +72,15 @@ object FileNameValidator {
         return null
     }
 
+    /**
+     * Checks the validity of file paths wanted to move or copied inside the folder.
+     *
+     * @param folderPath Target folder to be used for move or copy.
+     * @param filePaths The list of file paths to move or copy to folderPath.
+     * @param capability The capabilities affecting the validation criteria.
+     * @param context The context used for retrieving error messages.
+     * @return True if folder path and file paths are valid, false otherwise.
+     */
     fun checkFolderAndFilePaths(
         folderPath: String,
         filePaths: List<String>,