mirror of
https://github.com/Febbweiss/logstash-forwarder-java.git
synced 2026-03-04 22:25:39 +00:00
Fix bug #8.
This commit is contained in:
@@ -17,12 +17,12 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|||||||
2
.project
2
.project
@@ -17,7 +17,7 @@
|
|||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>logstash-forwarder-java</groupId>
|
<groupId>logstash-forwarder-java</groupId>
|
||||||
<artifactId>logstash-forwarder-java</artifactId>
|
<artifactId>logstash-forwarder-java</artifactId>
|
||||||
<version>0.2.0</version>
|
<version>0.2.1-SNAPSHOT</version>
|
||||||
<name>logstash-forwarder-java</name>
|
<name>logstash-forwarder-java</name>
|
||||||
<description>Java version of logstash forwarder</description>
|
<description>Java version of logstash forwarder</description>
|
||||||
<url>https://github.com/didfet/logstash-forwarder-java</url>
|
<url>https://github.com/didfet/logstash-forwarder-java</url>
|
||||||
|
|||||||
@@ -315,18 +315,21 @@ public class FileWatcher {
|
|||||||
for(File file : oldWatchMap.keySet()) {
|
for(File file : oldWatchMap.keySet()) {
|
||||||
FileState state = oldWatchMap.get(file);
|
FileState state = oldWatchMap.get(file);
|
||||||
if(state.isDeleted()) {
|
if(state.isDeleted()) {
|
||||||
if(markedList == null) {
|
if(! file.exists()) {
|
||||||
markedList = new ArrayList<File>();
|
if(markedList == null) {
|
||||||
|
markedList = new ArrayList<File>();
|
||||||
|
}
|
||||||
|
markedList.add(file);
|
||||||
}
|
}
|
||||||
markedList.add(file);
|
try {
|
||||||
|
state.getRandomAccessFile().close();
|
||||||
|
} catch(Exception e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(markedList != null) {
|
if(markedList != null) {
|
||||||
for(File file : markedList) {
|
for(File file : markedList) {
|
||||||
FileState state = oldWatchMap.remove(file);
|
FileState state = oldWatchMap.remove(file);
|
||||||
try {
|
|
||||||
state.getRandomAccessFile().close();
|
|
||||||
} catch(Exception e) {}
|
|
||||||
logger.trace("\tFile : " + file + " removed");
|
logger.trace("\tFile : " + file + " removed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user