Package org.eclipse.aether.internal.impl
Class DefaultTrackingFileManager
- java.lang.Object
-
- org.eclipse.aether.internal.impl.DefaultTrackingFileManager
-
- All Implemented Interfaces:
TrackingFileManager
@Singleton @Named public final class DefaultTrackingFileManager extends java.lang.Object implements TrackingFileManager
Manages access to a properties file.Note: the file locking in this component (that predates
SyncContext) is present only to back off two parallel implementations that coexist in Maven (this class andmaven-compatone), as in certain cases the two implementations may collide on properties files. This locking must remain in place for as long asmaven-compatcode exists. IMPORTANT: This class is kept fully in sync with the master branch one (w/ simple change to convert File to Path instances).
-
-
Constructor Summary
Constructors Constructor Description DefaultTrackingFileManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(java.io.File file)Deletes the specified properties file, if exists.java.util.Propertiesread(java.io.File file)Reads up the specified properties file intoProperties, if exists, otherwisenullis returned.java.util.Propertiesupdate(java.io.File file, java.util.Map<java.lang.String,java.lang.String> updates)Applies updates to specified properties file and returns resultingPropertieswith contents same as in updated file, nevernull.
-
-
-
Constructor Detail
-
DefaultTrackingFileManager
public DefaultTrackingFileManager()
-
-
Method Detail
-
read
public java.util.Properties read(java.io.File file)
Description copied from interface:TrackingFileManagerReads up the specified properties file intoProperties, if exists, otherwisenullis returned.- Specified by:
readin interfaceTrackingFileManager
-
update
public java.util.Properties update(java.io.File file, java.util.Map<java.lang.String,java.lang.String> updates)
Description copied from interface:TrackingFileManagerApplies updates to specified properties file and returns resultingPropertieswith contents same as in updated file, nevernull.- Specified by:
updatein interfaceTrackingFileManager
-
delete
public boolean delete(java.io.File file)
Description copied from interface:TrackingFileManagerDeletes the specified properties file, if exists. If file existed and was deleted, returnstrue.- Specified by:
deletein interfaceTrackingFileManager
-
-