Search in sources :

Example 31 with ByteSource

use of com.google.common.io.ByteSource in project solution-finder by knewjade.

the class UtilFigTetfuCaseTest method useTetfuCase1.

@Test
void useTetfuCase1() throws Exception {
    // オプションなし
    String tetfu = "v115@vhKSSYDEFLDmClcJSAVDEHBEooRBMoAVBzvKxCae/w?CauKWCzO8LCTnzPC0SNFDK3LMCU9aPC6ibMCU3TWCqyaFDT?+lPC6iHgCze9VCUeLuCK3ytCpXExCqvKxC6yLMCTe/VCvuz?PCPtjxCpiHgC6+TWCpirgCKuTxCTn/wCa+DWCa9aPCp+CMC?zuzPCsHDMCs+jPC0XMgCpvTxCM9aFDKO9VCz/dgC6yjFDpu?HgCvCmPCadNPCznFgC0CmFDMdFgCqyjFDPe/wCUdNPC6yKW?Cae/wCPNWWCKXNFDTNmPC6SFgCU9aFDK+DxCvvjFDpSNPCT?HmFDMefBAXqBznBGjBNpB0fBRmBesBMrBlqBTpBzgRpHeRp?IeI8wSwwH8wSwwH8JeSjBvhNxgBfZBybBFdB3bBzcBsaBWX?B9eBZkBysBskBWnBpeBegwhIewhBeAtBeg0EeBtg0Aei0gl?BeAtAeh0AeilAtCewhQ4xSwhQpAtA8APAtili0QpA8APAtx?hxwwhRpJefXBvhBzTBdTBpfwwBewhCeQ4AexwRpwhBeAtR4?g0wwRpwhAeBtg0Q4i0glwhAeBti0ilwwAeBtR4QpgWQ4wwA?tA8AeA8whA8RpxwQ4A8AeAtxhglQpxwQ4AeBtglwhilg0Q4?AeBtili0QpAeBtxhxwwhRpAAA8HeAAA8ReXxAvhETrA+nAM?0AZBBKBBweg0Ieg0FeRph0glDeAtRpR4glCeBtwwR4whhlA?eQ4AtxwRpQLwhAeAtR4g0wwRpQLA8AeD8xwhlg0AeC8Atxw?xhgWC8BtQpxhQ4gWg0A8whAtRpxwQ4QaA8AtxhglQpxwQ4A?AA8HeAAA8HeA8EeAACeA8EeAACeA8EeAACeA8EeAACeA8Ee?AAMecpAvhF5yAz3AF5Ay6AO8A3+AAfR4Aeg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fPB2LBxeg0I?ei0CeglQ4Beh0glBeAtglR4AeC8AeN8AeI8AeD8AeI8AeI8?AeF8glE8AeC8ilC8gWwhB8hlg0A8AeAtg0xhA8CeA8AAIeA?ACeA8IeA8AACeA8EeAACeA8EeAACeA8EeAAJepdAC8AeI8A?eL8AeI8AeG8AeD8Q4glC8AeD8Q4ilA8AeA8g0whA8Q4hlg0?B8Atg0xhQaCeA8EeAAHeA8AAHeA8AACeA8AAHeA8AAHeA8A?AIeAAAeA8GeAAAeA8ieAAFeA8BeAAFeA8BeAAFeA8BeAAFe?A8JeAAA";
    String command = String.format("util fig -t %s", tetfu);
    RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
    ByteSource actual = FigureFileHelper.loadGifByteSource();
    ByteSource expect = FigureFileHelper.loadResourceByteSource(UtilFigResources.TetfuCase1);
    assertThat(actual.contentEquals(expect)).isTrue();
}
Also used : ByteSource(com.google.common.io.ByteSource) Test(org.junit.jupiter.api.Test)

Example 32 with ByteSource

use of com.google.common.io.ByteSource in project solution-finder by knewjade.

the class UtilFigTetfuCaseTest method useTetfuCase3.

@Test
void useTetfuCase3() throws Exception {
    // オプション: next, delay, frame:no
    String tetfu = "v115@vhWRQYgBFLDmClcJSAVDEHBEooRBJoAVBTnjWC0PNP?CsuLuCPHOMC6vTWC0/TFDTuKWCJ3jPC0HztC0n9VCKn/wCT?+TFDUe/VCzHDMC6yytCqubMCvvTWC0nltCsuHgC3mBTpBcq?BykB+tBlsBetBpjBKkBUnBFrBzpBXrBzhBZaB8lBlsBXqBC?lB+oBWgBiVBLgilGeglg0Hewhi0Eeg0QaBeglEeg0QaAPR4?AtRpAeh0AexhgWAtRpBeQLQ4i0AeD8glQag0xhAtxwA8hlQ?axhBtxwB8Q4JesSBvhBlYBXUBBgilGeglg0DeAtAeR4QaBt?g0AeBtR4g0QaAPhlAeAtwhwwgWQaAexhgWAtRaxDQLQ4i0A?eAtSpglQaxhBtxwB8Q4AACeA8EeA8FeAABeA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AeA8CeAASeA8AeAACeAAEeA8geA8Fe?AAGeAAAeA88eTTAvhIvjA2eAEkA0jApqATwA1zAG1Af2AQe?Q4IeR4DewwAei0Q4AeA8AeI8AeI8AeI8AeP8AeG8AewhH8A?exhD8QpA8glgHglwhA8AeA8DeAADeA8DeAADeA8DeAADeA8?DeAAIeAAAeA8MeAACeA8GeAAAeA8GeAAAeA8GeAAAeA8CeA?AEeA8Me6UAvhAcVACeAtCeQ4DeBtCeR4AehlAtwwAei0Q4A?eA8AeA8AtC8whC8AeBtC8xhA8h0AtQpA8ilwDA8AeA8DeAA?DeA8DeAAIeAAAeA8+eAACeA8GeAAAeA8GeAAAeA8EeA8AeA?AEeAACeA8IeA8CeAAEeA8BeAABeA8FeAALeAAA";
    String command = String.format("util fig -t %s -n 1 -d 50 -f no", tetfu);
    RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
    ByteSource actual = FigureFileHelper.loadGifByteSource();
    ByteSource expect = FigureFileHelper.loadResourceByteSource(UtilFigResources.TetfuCase3);
    assertThat(actual.contentEquals(expect)).isTrue();
}
Also used : ByteSource(com.google.common.io.ByteSource) Test(org.junit.jupiter.api.Test)

Example 33 with ByteSource

use of com.google.common.io.ByteSource in project solution-finder by knewjade.

the class UtilFigTetfuCaseTest method useTetfuCase7.

@Test
void useTetfuCase7() throws Exception {
    // オプション: line:4, next:9
    String tetfu = "v115@vhKyOYPCFLDmClcJSAVDEHBEooRBMoAVBvP9wCzXst?CpuPFDPn/wCJNUFDsuPFDPdNFDzCOMCvvKxCzfbMCs+ytC6?i3LCTnjxCK+DxCJ9aFDqiHgCzn9VC0X+tCqyCMCUdNPCaHU?PCpHcgCseltCs/dgCa9KWC033LCUdNFDv/TPCJ9KxCaHstC?pX2BATkBmfB9tBXjB0sBRmBqqBvrBFsBWwBOgg0Iei0DeE8?AeF8AeI8AeI8AeI8AeI8AeglH8AeilD8JexOBvhGzGBTFBO?GBsNB5JBFNByNBpfglwhFeilwhBeh0Aeyw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l 4 -n 9", tetfu);
    RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
    ByteSource actual = FigureFileHelper.loadGifByteSource();
    ByteSource expect = FigureFileHelper.loadResourceByteSource(UtilFigResources.TetfuCase7);
    assertThat(actual.contentEquals(expect)).isTrue();
}
Also used : ByteSource(com.google.common.io.ByteSource) Test(org.junit.jupiter.api.Test)

Example 34 with ByteSource

use of com.google.common.io.ByteSource in project solution-finder by knewjade.

the class UtilFigTetfuCaseTest method useTetfuCase4.

@Test
void useTetfuCase4() throws Exception {
    // オプション: next, delay, frame:right, start:10, end:30
    String tetfu = "v115@vhKSSYXDFLDmClcJSAVDEHBEooRBMoAVBTn/wCpXEx?Cz33LCvi3LCa3TxCqXstCJHWWCvfbMCz+jPCaX9wCsfjxCT?uKWCUentC6yytC0/TFDJn/VCUuaFDTnLuCqCOMC0vCMCaN8?LC0/LgCaN+tCvPNFDsOUFDTXNPCaentC0yCMCz3HgCsOegC?pHkPCsuntCpirgCat3LC0ySgCqe9VCzXUFDUeHgCzyLMCqu?rgCzeFgCs3/wC6vTWCJnLuCMe/wCvC+tCan3LC03HgCT+jB?A3qBznBGjBtpBZkBUgBymBfsBErB2uBLgg0Iei0GeI8AeC8?AeI8AeI8AeI8AeF8glB8AeF8ilAeF8Je9PBvhM5lBzaBiVB?2mB8iBzcBvZB9YB2QBMXB5lBiiBpeBegwhIewhg0EeilAei?0BeAtglwwQ4AeAPhlAeBtRpwwg0APxSAeAtQawhAewSg0gW?h0A8BtRpxhgWxwA8AtxwQpAtwhJezOBvhRNXB/QBaRBzNB8?MB5bB+jB3iBlhBWlB3bBMZBZkBTpBiqB2kB0mBlgBVgg0Ae?ywEei0wwBtCeAtRpilBtAeBtRpglR4CeAtg0glA8SpD8Aei?lQpBtC8APxwi0BtA8AtAPxwg0xhC8AtgHJe/GBvhERCBTKB?lTBSdBhWBjfQ4zhEeR4zhBeRpg0Q4ywBeglRpI8AeI8AeI8?AewhT4D8AewhwDT4B8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8FeAAA8HeAAA8MeOPBvhATPBNg?AtQ4DeRpwhAtBeQ4EeQ4BtxhA8AeA8xwOeAAA8keAAA8NeC?FBvhGFOBJOBTQBphBMrBXrBWtBEhg0FeR4whAeh0RpAeQ4A?ewSAeCPwwwSA8xhAtQ4i0JeNfBLgwwIexwEeg0BewwCeR4w?hi0RpAeR4AtwhilQpAeH8RpA8AeC8glB8QpB8AexhQ4ilxw?A8wDwhAtQ4i0AeA8AeAAPeFRBvhCyXBfUB+RBmfg0CeQ4Be?wwBeg0BeglR4Aexwh0ilg0Q4AeA8AeK8AeI8gHC8whB8QpB?8gHB8g0xhA8RpglgHi0glwhA8AeA8BeAAHeA8AAHeA8AAHe?A8AAHeA8AAOe67AvhGs8AT+AM/A38A5MBZmB+oB8gg0GeAt?CeR4CeAtAeg0AeA8xhA8AeA8BthlDeA8DeAAJeifBvhNzcB?FmBOoBzlB9nBKkBXdBUhBScBUTBFlBJjBelBTfBugBtAewh?AeRpg0BegWAeAtEehlAeRpBeQaQpAehlwwAegWBeg0hlBtx?hQpQ4EeAADeA8Je/WBvhHaXBpjBvoBGnBpZBNkBskB3nBKg?whIewhBeAtDeR4whwwBtCeS4whD8AeE8AeH8Q4AeH8Q4AeA?8AtD8xhQ4QLBtC8yhQ4CeAAA8OezIBvhEFSBZfBKkBziBOm?BVgglCeh0AeRpwhglCeg0TpwhhlAtAeg0RpR4whC8AeF8g0?C8hlA8wSwwQ4g0C8glxwwSwwQ4h0AtA8glxwwDwhQ4CeA8C?eAALeMJBvhV0GBlDB+FBfABy+AT2ApnA30A8wAivAxBBlHB?WRB6WBNVBTWB/VBUWBGdBzbB5nBAAA";
    String command = String.format("util fig -t %s -n 9 -d 21 -f right -s 10 -e 30", tetfu);
    RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
    ByteSource actual = FigureFileHelper.loadGifByteSource();
    ByteSource expect = FigureFileHelper.loadResourceByteSource(UtilFigResources.TetfuCase4);
    assertThat(actual.contentEquals(expect)).isTrue();
}
Also used : ByteSource(com.google.common.io.ByteSource) Test(org.junit.jupiter.api.Test)

Example 35 with ByteSource

use of com.google.common.io.ByteSource in project alliance by codice.

the class OrderRequestImpl method writeTarFile.

private void writeTarFile(DestinationSink destinationSink, PackagingSpecFormatType packagingSpecFormatType, String filename, List<String> sentFiles, ResourceContainer file, List<Metacard> metacards) throws IOException {
    try (TemporaryFileBackedOutputStream tarFos = new TemporaryFileBackedOutputStream(MAX_MEMORY_SIZE);
        TarOutputStream tarOut = new TarOutputStream(tarFos)) {
        getTar(tarOut, file);
        try (TemporaryFileBackedOutputStream zipFos = new TemporaryFileBackedOutputStream(MAX_MEMORY_SIZE);
            ZipOutputStream zipOut = new ZipOutputStream(zipFos)) {
            getZip(zipOut, tarFos.asByteSource().openStream(), filename + ".tar");
            ByteSource contents = zipFos.asByteSource();
            writeFile(destinationSink, packagingSpecFormatType, filename, sentFiles, contents, metacards);
        }
    }
}
Also used : TarOutputStream(org.kamranzafar.jtar.TarOutputStream) TemporaryFileBackedOutputStream(org.codice.ddf.platform.util.TemporaryFileBackedOutputStream) ZipOutputStream(java.util.zip.ZipOutputStream) ByteSource(com.google.common.io.ByteSource)

Aggregations

ByteSource (com.google.common.io.ByteSource)138 IOException (java.io.IOException)58 Test (org.junit.Test)58 InputStream (java.io.InputStream)42 ByteArrayInputStream (java.io.ByteArrayInputStream)33 File (java.io.File)33 ContentItemImpl (ddf.catalog.content.data.impl.ContentItemImpl)18 Metacard (ddf.catalog.data.Metacard)17 ContentItem (ddf.catalog.content.data.ContentItem)16 StringWriter (java.io.StringWriter)14 FileInputStream (java.io.FileInputStream)13 Test (org.junit.jupiter.api.Test)12 URI (java.net.URI)11 Path (java.nio.file.Path)11 ArrayList (java.util.ArrayList)11 URL (java.net.URL)10 CreateStorageRequestImpl (ddf.catalog.content.operation.impl.CreateStorageRequestImpl)9 ByteArrayOutputStream (java.io.ByteArrayOutputStream)9 TemporaryFileBackedOutputStream (org.codice.ddf.platform.util.TemporaryFileBackedOutputStream)9 FilterInputStream (java.io.FilterInputStream)8