forked from Linyuzai/concept
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
113 additions
and
164 deletions.
There are no files selected for viewing
26 changes: 0 additions & 26 deletions
26
...src/main/java/com/github/linyuzai/download/core/compress/AbstractCompressSourceEvent.java
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
.../src/main/java/com/github/linyuzai/download/core/compress/AfterSourceCompressedEvent.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...-core/src/main/java/com/github/linyuzai/download/core/compress/SourceCompressedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
import com.github.linyuzai.download.core.utils.DownloadUtils; | ||
import lombok.Getter; | ||
|
||
/** | ||
* {@link Source} 压缩完成后会发布该事件。 | ||
*/ | ||
@Getter | ||
public class SourceCompressedEvent extends AbstractSourceEvent { | ||
|
||
/** | ||
* 压缩后的对象 | ||
*/ | ||
private final Compression compression; | ||
|
||
public SourceCompressedEvent(DownloadContext context, Source source, Compression compression) { | ||
super(context, source); | ||
this.compression = compression; | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...main/java/com/github/linyuzai/download/core/compress/SourceCompressedUsingCacheEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
import lombok.Getter; | ||
|
||
/** | ||
* {@link Source} 压缩使用缓存时会发布该事件。 | ||
*/ | ||
@Getter | ||
public class SourceCompressedUsingCacheEvent extends AbstractCompressSourceEvent { | ||
public class SourceCompressedUsingCacheEvent extends AbstractSourceEvent { | ||
|
||
/** | ||
* 缓存 | ||
*/ | ||
private final String cache; | ||
|
||
public SourceCompressedUsingCacheEvent(DownloadContext context, Source source, String cache) { | ||
super(context, source, "Compress source using cache " + cache); | ||
super(context, source); | ||
this.cache = cache; | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...rc/main/java/com/github/linyuzai/download/core/compress/SourceCompressionFormatEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
import lombok.Getter; | ||
|
||
/** | ||
* 当确定 {@link Source} 压缩格式时会发布该事件。 | ||
*/ | ||
@Getter | ||
public class SourceCompressionFormatEvent extends AbstractCompressSourceEvent { | ||
public class SourceCompressionFormatEvent extends AbstractSourceEvent { | ||
|
||
/** | ||
* 压缩格式 | ||
*/ | ||
private final String format; | ||
|
||
public SourceCompressionFormatEvent(DownloadContext context, Source source, String format) { | ||
super(context, source, "Compress source using " + format); | ||
super(context, source); | ||
this.format = format; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...rc/main/java/com/github/linyuzai/download/core/compress/SourceMemoryCompressionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
|
||
/** | ||
* 当使用 {@link MemoryCompression} 内存压缩时会发布该事件。 | ||
*/ | ||
public class SourceMemoryCompressionEvent extends AbstractCompressSourceEvent { | ||
public class SourceMemoryCompressionEvent extends AbstractSourceEvent { | ||
|
||
public SourceMemoryCompressionEvent(DownloadContext context, Source source) { | ||
super(context, source, "Compress source in memory"); | ||
super(context, source); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...re/src/main/java/com/github/linyuzai/download/core/compress/SourceNoCompressionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
|
||
/** | ||
* 当使用 {@link NoCompression} 不压缩时会发布该事件。 | ||
*/ | ||
public class SourceNoCompressionEvent extends AbstractCompressSourceEvent { | ||
public class SourceNoCompressionEvent extends AbstractSourceEvent { | ||
|
||
public SourceNoCompressionEvent(DownloadContext context, Source source) { | ||
super(context, source, "Compression skipped"); | ||
super(context, source); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.