mirror of https://github.com/apache/activemq.git
Fixes AMQ-6441 where a negative value can be returned with large AWS EFS files systems when calling java.io.File.getTotalSpace()
This commit is contained in:
parent
dc68ad8967
commit
f225120f61
|
@ -0,0 +1,25 @@
|
|||
package org.apache.activemq.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author wcrowell
|
||||
*
|
||||
* LargeFile is used to simulate a large file system (e.g. exabytes in size).
|
||||
* The getTotalSpace() method is intentionally set to exceed the largest
|
||||
* value of a primitive long which is 9,223,372,036,854,775,807. A negative
|
||||
* number will be returned when getTotalSpace() is called. This class is for
|
||||
* test purposes only. Using a mocking framework to mock the behavior of
|
||||
* java.io.File was a lot of work.
|
||||
*
|
||||
*/
|
||||
public class LargeFile extends File {
|
||||
public LargeFile(File parent, String child) {
|
||||
super(parent, child);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTotalSpace() {
|
||||
return Long.MAX_VALUE + 4193L;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue