当前位置: 首页>>代码示例>>Java>>正文


Java Pathss类代码示例

本文整理汇总了Java中de.pfabulist.kleinod.paths.Pathss的典型用法代码示例。如果您正苦于以下问题:Java Pathss类的具体用法?Java Pathss怎么用?Java Pathss使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Pathss类属于de.pfabulist.kleinod.paths包,在下文中一共展示了Pathss类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testNewIV

import de.pfabulist.kleinod.paths.Pathss; //导入依赖的package包/类
@Test
public void testNewIV() throws InvalidKeyException, IOException, InvalidAlgorithmParameterException {
    CipherProvider de = new CipherProvider( blockCipher, "passwd".toCharArray() );

    Path file = Pathss.getTmpDir( "testNewIV" ).resolve( "foo" );
    Files.createDirectories( file.getParent() );
    Files.write( file, "duda".getBytes( "UTF-8" ) );
    Path target = Pathss.getTmpDir( "tt" ).resolve( "target" );
    Files.createDirectories( target.getParent() );
    Path file2 = file.getParent().resolve( "back" );

    CopyWith foo = new CopyWithEncryption( de );
    foo.copyEncrypt( file, target, false );

    assertThat( Files.readAllBytes( file )).isNotEqualTo( Files.readAllBytes( target ));
    foo.copyDecrypt( target, file2, false );

    assertThat( Files.readAllBytes( file2 )).isEqualTo(  Files.readAllBytes( file ) );
}
 
开发者ID:openCage,项目名称:stellvertreter,代码行数:20,代码来源:CopyEncryptedTest.java

示例2: string2EncryptionWithNewPasswordEntryWorks

import de.pfabulist.kleinod.paths.Pathss; //导入依赖的package包/类
@Test
public void string2EncryptionWithNewPasswordEntryWorks() throws InvalidKeyException, IOException, InvalidAlgorithmParameterException {
    CipherProvider     cipherProviderDifferent = new CipherProvider( blockCipher, "passwd".toCharArray(), cipherProvider.getSalt() );
    CopyWith copyEncryptedDifferent  = new CopyWithEncryption( cipherProviderDifferent );

    Path src = Pathss.getTmpDir( "aff" ).resolve( "foo" );
    Files.createDirectories( src.getParent() );
    Files.write( src, "duda".getBytes( "UTF-8" ) );

    Path enc = src.getParent().resolve( "env" );
    Path tgt = src.getParent().resolve( "tgt" );

    copyEncrypted.copyEncrypt( src, enc, false );
    copyEncryptedDifferent.copyDecrypt( enc, tgt, false );


    assertThat( Files.readAllBytes( tgt )).isEqualTo( Files.readAllBytes( src ));
}
 
开发者ID:openCage,项目名称:stellvertreter,代码行数:19,代码来源:CopyEncryptedTest.java

示例3: build

import de.pfabulist.kleinod.paths.Pathss; //导入依赖的package包/类
public FileSystem build() {

        if ( host == null ) {
            throw new IllegalStateException( "no host" );
        }

        return Pathss.getOrCreate(
                URI.create( "stellvertreter" + ":" + host.toUri() + "!/" ),
                env );
    }
 
开发者ID:openCage,项目名称:stellvertreter,代码行数:11,代码来源:StellvertreterBuilder.java

示例4: testRe

import de.pfabulist.kleinod.paths.Pathss; //导入依赖的package包/类
@Test
public void testRe() throws IOException {
    Path host = Pathss.getTmpDir( "rere" );

    {
        Filess.createDirectories( host );

        Path clear = memoryFS().build( "mmclear" ).getPath( "/" );

        FileSystem fs = stellvertreter().
                host( host ).
                clear( clear ).
                password( "foo".toCharArray() ).build();
        //StellvertreterProvider.getUrim().getOrCreateFS( host, Collections.singletonMap( "clear", clear ) );
        Path play = fs.getPath( "/tmp" );
        Files.createDirectories( play );

        fs.close();
        clear.getFileSystem().close();
    }

    {
        Path clear2 = memoryFS().build( "mmclear2" ).getPath( "/" );

        FileSystem fs2 = stellvertreter().
                host( host ).
                clear( clear2 ).
                password( "foo".toCharArray() ).build();

        assertThat( Files.exists( fs2.getPath( "/tmp" ) )).isTrue();

    }


}
 
开发者ID:openCage,项目名称:stellvertreter,代码行数:36,代码来源:ReopenTest.java

示例5: testReadCompatibility

import de.pfabulist.kleinod.paths.Pathss; //导入依赖的package包/类
@Test
public void testReadCompatibility() {

    Path target = Pathss.getTmpDir( "fm-comp").resolve( "ex" );

    try ( InputStream in = getClass().getClassLoader().getResourceAsStream( "de/pfabulist/lindwurm/stellvertreter/ex.fm" )) {

        Files.createDirectories( target.getParent() );
        Files.copy( in, target );

    } catch( IOException e ) {
        e.printStackTrace();
    }

    FileMeta fm = fmio.read( target, null );
    assertThat( fm.name ).isEqualTo( "example" );

}
 
开发者ID:openCage,项目名称:stellvertreter,代码行数:19,代码来源:FMIOTest.java


注:本文中的de.pfabulist.kleinod.paths.Pathss类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。