[
https://issues.apache.org/jira/browse/AMQ-9830?focusedWorklogId=1001522&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1001522
]
ASF GitHub Bot logged work on AMQ-9830:
---------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jan/26 09:41
Start Date: 23/Jan/26 09:41
Worklog Time Spent: 10m
Work Description: jeanouii commented on code in PR #1629:
URL: https://github.com/apache/activemq/pull/1629#discussion_r2720463476
##########
activemq-jaas/src/test/java/org/apache/activemq/jaas/PropertiesLoginModuleTest.java:
##########
@@ -92,10 +94,10 @@ public void testLoginReload() throws Exception {
//Modify the file and test that the properties are reloaded
Thread.sleep(1000);
- FileUtils.copyFile(new File(sourcePropDir, "usersReload.properties"),
usersFile);
- FileUtils.copyFile(new File(sourcePropDir, "groupsReload.properties"),
groupsFile);
- FileUtils.touch(usersFile);
- FileUtils.touch(groupsFile);
+ Files.copy(new File(sourcePropDir, "usersReload.properties").toPath(),
usersFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ Files.copy(new File(sourcePropDir,
"groupsReload.properties").toPath(), groupsFile.toPath(),
StandardCopyOption.REPLACE_EXISTING);
+ Files.setLastModifiedTime(usersFile.toPath(),
FileTime.from(Instant.now()));
Review Comment:
Attributes are not guaranteed to be copied actually, unless you add
COPY_ATTRIBUTES option at the end. This is JVM specific so you might get the
source file's timestamp or the current time of the copy.
So strictly speaking, to mimic FileUtiles.touch(), setting last modified
date makes sense here to trigger reloading for instance.
Issue Time Tracking
-------------------
Worklog Id: (was: 1001522)
Time Spent: 0.5h (was: 20m)
> Replace commons-io test usage in activemq-jaas with Java NIO
> ------------------------------------------------------------
>
> Key: AMQ-9830
> URL: https://issues.apache.org/jira/browse/AMQ-9830
> Project: ActiveMQ
> Issue Type: Task
> Reporter: Matt Pavlovich
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact