You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -197,6 +221,20 @@ public static void createValidationFiles(URLConnection resourceUrlConnection, Fi
197
221
}
198
222
}
199
223
224
+
/**
225
+
* Validate a local file based on pre-existing metadata files for size and hash.<br>
226
+
* If the passed in <code>localFile</code> parameter is a file named <code>file.ext</code>, the function searches in the same folder for:
227
+
* <ul>
228
+
* <li><code>file.ext.size</code>: if found, it compares the size stored in it to the length of <code>localFile</code> (in bytes).</li>
229
+
* <li><code>file.ext.hash</code>: if found, it compares the size stored in it to the hash code of <code>localFile</code>.</li>
230
+
* </ul>
231
+
* If any of these comparisons fail, the function returns <code>false</code>. otherwise it returns true.
232
+
* <p>
233
+
* This function does not implement hash code verification yet.
234
+
* @param localFile The file to validate
235
+
* @return <code>false</code> if any of the size or hash code metadata files exists but its contents does not match the expected value in the file, <code>true'</code> otherwise.
0 commit comments