Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Clean
|
| 2026-01-13 00:00 | #246 | completed |
Clean
|
| 2026-01-11 00:00 | #240 | completed |
Clean
|
| 2026-01-10 00:00 | #237 | completed |
Clean
|
| 2026-01-09 00:34 | #234 | completed |
Clean
|
| 2026-01-08 00:53 | #231 | completed |
Clean
|
| 2025-08-19 00:01 | #85 | completed |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Clean
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
import java.io.*;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.file.*;
// Add the following code to a new or existing function
String fileSharePath = "Z:\\file-share";
String fileName = "test.txt";
String filePath = Paths.get(fileSharePath, fileName).toString();
try (
FileOutputStream fos = new FileOutputStream(filePath);
FileChannel fileChannel = fos.getChannel()) {
// Acquire an exclusive lock on this file
FileLock lock = fileChannel.lock();
System.out.println("File is locked.");
// Perform file operations here
// Release the lock
lock.release();
System.out.println("File lock released.");
} catch (Exception e) {
e.printStackTrace();
}
String fileSharePath = "Z:\\file-share";
import java.io.*;
import java.nio.file.*;
// Add the following code to a new or existing function
String fileSharePath = "Z:\\file-share";
try {
File directory = new File(fileSharePath);
File[] dirs = directory.listFiles(File::isDirectory);
if (dirs != null) {
for (File dir : dirs) {
System.out.println(dir.getName());
}
System.out.println(dirs.length + " directories found.");
}
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
import java.io.*;
import java.nio.file.*;
import java.util.Arrays;
// Add the following code to a new or existing function
String fileSharePath = "Z:\\file-share";
String fileName = "test.txt";
try {
String textToWrite = "First line" + System.lineSeparator();
Path filePath = Paths.get(fileSharePath, fileName);
// Write initial content to file
Files.write(filePath, textToWrite.getBytes());
System.out.println("Initial text written to file");
// Append additional lines to the file
String[] textToAppend = { "Second line", "Third line" };
Files.write(filePath,
Arrays.asList(textToAppend),
StandardOpenOption.APPEND);
System.out.println("Additional lines appended to file");
} catch (IOException ex) {
System.out.println("Error writing to file: " + ex.getMessage());
}
import java.nio.file.*;
import java.nio.file.attribute.AclEntry;
import java.nio.file.attribute.AclFileAttributeView;
import java.util.List;
// Add the following code to a new or existing function
String fileSharePath = "Z:\\file-share";
String fileName = "test.txt";
String filePath = Paths.get(fileSharePath, fileName).toString();
try {
Path path = Paths.get(filePath);
// Get the ACL view for the file
AclFileAttributeView aclView = Files.getFileAttributeView(
path, AclFileAttributeView.class);
// Get the ACL entries
List<AclEntry> aclEntries = aclView.getAcl();
// List all access rules for the file
for (AclEntry entry : aclEntries) {
System.out.println("Identity: " + entry.principal().getName());
System.out.println("Access Control Type: " + entry.type());
System.out.println("File System Rights: " + entry.permissions());
System.out.println();
}
System.out.println(aclEntries.size() + " ACL entries found.");
} catch (Exception ex) {
System.out.println("Error: " + ex.getMessage());
}
import com.azure.storage.file.share.*;
// Add the following code to a new or existing function
String connectionString = "<connection-string>";
String shareName = "<share-name>";
// Create the ShareClient
ShareClient shareClient = new ShareClientBuilder()
.shareName(shareName)
.connectionString(connectionString)
.buildClient();
// Create a client to interact with a directory in the share
ShareDirectoryClient directoryClient = shareClient.getDirectoryClient("sample-directory");