Search in sources :

Example 6 with Files

use of java.nio.file.Files in project intellij-community by JetBrains.

the class LocalFileSystemTest method doTestInterruptedRefresh.

public static void doTestInterruptedRefresh(@NotNull File top) throws Exception {
    for (int i = 1; i <= 3; i++) {
        File sub = IoTestUtil.createTestDir(top, "sub_" + i);
        for (int j = 1; j <= 3; j++) {
            IoTestUtil.createTestDir(sub, "sub_" + j);
        }
    }
    Files.walkFileTree(top.toPath(), new SimpleFileVisitor<Path>() {

        @Override
        public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
            for (int k = 1; k <= 3; k++) {
                IoTestUtil.createTestFile(dir.toFile(), "file_" + k, ".");
            }
            return FileVisitResult.CONTINUE;
        }
    });
    VirtualFile topDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(top);
    assertNotNull(topDir);
    Set<VirtualFile> files = ContainerUtil.newHashSet();
    VfsUtilCore.processFilesRecursively(topDir, file -> {
        if (!file.isDirectory())
            files.add(file);
        return true;
    });
    // 13 dirs of 3 files
    assertEquals(39, files.size());
    topDir.refresh(false, true);
    Set<VirtualFile> processed = ContainerUtil.newHashSet();
    MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect();
    connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {

        @Override
        public void after(@NotNull List<? extends VFileEvent> events) {
            events.forEach(e -> processed.add(e.getFile()));
        }
    });
    try {
        files.forEach(f -> IoTestUtil.updateFile(new File(f.getPath()), "+++"));
        ((NewVirtualFile) topDir).markDirtyRecursively();
        RefreshWorker.setCancellingCondition(file -> file.getPath().endsWith(top.getName() + "/sub_2/file_2"));
        topDir.refresh(false, true);
        assertThat(processed.size()).isGreaterThan(0).isLessThan(files.size());
        RefreshWorker.setCancellingCondition(null);
        topDir.refresh(false, true);
        assertThat(processed).isEqualTo(files);
    } finally {
        connection.disconnect();
        RefreshWorker.setCancellingCondition(null);
    }
}
Also used : Path(java.nio.file.Path) VfsRootAccess(com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess) java.util(java.util) WriteAction(com.intellij.openapi.application.WriteAction) ArrayUtil(com.intellij.util.ArrayUtil) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) FileAttributes(com.intellij.openapi.util.io.FileAttributes) ContainerUtil(com.intellij.util.containers.ContainerUtil) FileSystemUtil(com.intellij.openapi.util.io.FileSystemUtil) MessageBusConnection(com.intellij.util.messages.MessageBusConnection) com.intellij.openapi.vfs.newvfs(com.intellij.openapi.vfs.newvfs) PersistentFSImpl(com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl) VFileCreateEvent(com.intellij.openapi.vfs.newvfs.events.VFileCreateEvent) FileUtil(com.intellij.openapi.util.io.FileUtil) VFileDeleteEvent(com.intellij.openapi.vfs.newvfs.events.VFileDeleteEvent) Path(java.nio.file.Path) VFileEvent(com.intellij.openapi.vfs.newvfs.events.VFileEvent) SimpleFileVisitor(java.nio.file.SimpleFileVisitor) RefreshWorker(com.intellij.openapi.vfs.newvfs.persistent.RefreshWorker) PlatformTestUtil(com.intellij.testFramework.PlatformTestUtil) Files(java.nio.file.Files) StringUtil(com.intellij.openapi.util.text.StringUtil) PlatformTestCase(com.intellij.testFramework.PlatformTestCase) PersistentFS(com.intellij.openapi.vfs.newvfs.persistent.PersistentFS) IOException(java.io.IOException) VirtualDirectoryImpl(com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl) VFileContentChangeEvent(com.intellij.openapi.vfs.newvfs.events.VFileContentChangeEvent) SystemInfo(com.intellij.openapi.util.SystemInfo) File(java.io.File) FileVisitResult(java.nio.file.FileVisitResult) ApplicationManager(com.intellij.openapi.application.ApplicationManager) IoTestUtil(com.intellij.openapi.util.io.IoTestUtil) com.intellij.openapi.vfs(com.intellij.openapi.vfs) GeneralSettings(com.intellij.ide.GeneralSettings) VirtualFileSystemEntry(com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry) ObjectUtils(com.intellij.util.ObjectUtils) NotNull(org.jetbrains.annotations.NotNull) MessageBusConnection(com.intellij.util.messages.MessageBusConnection) FileVisitResult(java.nio.file.FileVisitResult) IOException(java.io.IOException) File(java.io.File)

Example 7 with Files

use of java.nio.file.Files in project proxyee-down by monkeyWie.

the class HttpDownController method getChildDirList.

@RequestMapping("/getChildDirList")
public ResultInfo getChildDirList(@RequestBody(required = false) DirForm body) {
    ResultInfo resultInfo = new ResultInfo();
    List<DirInfo> data = new LinkedList<>();
    resultInfo.setData(data);
    File[] files;
    if (body == null || StringUtils.isEmpty(body.getPath())) {
        if (OsUtil.isMac()) {
            files = new File("/Users").listFiles(file -> file.isDirectory() && file.getName().indexOf(".") != 0);
        } else {
            files = File.listRoots();
        }
    } else {
        File file = new File(body.getPath());
        if (file.exists() && file.isDirectory()) {
            files = file.listFiles();
        } else {
            resultInfo.setStatus(ResultStatus.BAD.getCode()).setMsg("路径不存在");
            return resultInfo;
        }
    }
    if (files != null && files.length > 0) {
        boolean isFileList = "file".equals(body.getModel());
        for (File tempFile : files) {
            if (tempFile.isFile()) {
                if (isFileList) {
                    data.add(new DirInfo(StringUtils.isEmpty(tempFile.getName()) ? tempFile.getAbsolutePath() : tempFile.getName(), tempFile.getAbsolutePath(), true));
                }
            } else if (tempFile.isDirectory() && (tempFile.getParent() == null || !tempFile.isHidden()) && (OsUtil.isWindows() || tempFile.getName().indexOf(".") != 0)) {
                DirInfo dirInfo = new DirInfo(StringUtils.isEmpty(tempFile.getName()) ? tempFile.getAbsolutePath() : tempFile.getName(), tempFile.getAbsolutePath(), tempFile.listFiles() == null ? true : Arrays.stream(tempFile.listFiles()).noneMatch(file -> file != null && (file.isDirectory() || isFileList) && !file.isHidden()));
                data.add(dirInfo);
            }
        }
    }
    return resultInfo;
}
Also used : Arrays(java.util.Arrays) HttpDownConstant(lee.study.down.constant.HttpDownConstant) BdyZip(lee.study.down.io.BdyZip) BdyZipEntry(lee.study.down.io.BdyZip.BdyZipEntry) RequestParam(org.springframework.web.bind.annotation.RequestParam) ContentManager(lee.study.down.content.ContentManager) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) ResultStatus(lee.study.down.model.ResultInfo.ResultStatus) FileUtil(lee.study.down.util.FileUtil) TaskInfo(lee.study.down.model.TaskInfo) UpdateService(lee.study.down.update.UpdateService) DirInfo(lee.study.down.model.DirInfo) DirForm(lee.study.down.mvc.form.DirForm) HttpDownApplication(lee.study.down.gui.HttpDownApplication) Map(java.util.Map) GithubUpdateService(lee.study.down.update.GithubUpdateService) HttpDownCallback(lee.study.down.dispatch.HttpDownCallback) Collectors(java.util.stream.Collectors) UnzipForm(lee.study.down.mvc.form.UnzipForm) RestController(org.springframework.web.bind.annotation.RestController) UpdateInfo(lee.study.down.model.UpdateInfo) List(java.util.List) WsForm(lee.study.down.mvc.form.WsForm) BootstrapException(lee.study.down.exception.BootstrapException) ProxyConfig(lee.study.proxyee.proxy.ProxyConfig) HttpDownStatus(lee.study.down.constant.HttpDownStatus) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Value(org.springframework.beans.factory.annotation.Value) RequestBody(org.springframework.web.bind.annotation.RequestBody) AbstractHttpDownBootstrap(lee.study.down.boot.AbstractHttpDownBootstrap) BdyUnzipCallback(lee.study.down.io.BdyZip.BdyUnzipCallback) ConfigInfo(lee.study.down.model.ConfigInfo) LinkedList(java.util.LinkedList) BuildTaskForm(lee.study.down.mvc.form.BuildTaskForm) Desktop(java.awt.Desktop) NewTaskForm(lee.study.down.mvc.form.NewTaskForm) Logger(org.slf4j.Logger) MalformedURLException(java.net.MalformedURLException) Files(java.nio.file.Files) HttpRequestInfo(lee.study.down.model.HttpRequestInfo) WsDataType(lee.study.down.mvc.ws.WsDataType) ResultInfo(lee.study.down.model.ResultInfo) IOException(java.io.IOException) File(java.io.File) UnzipInfo(lee.study.down.model.UnzipInfo) OsUtil(lee.study.down.util.OsUtil) DownContent(lee.study.down.content.DownContent) HttpDownInfo(lee.study.down.model.HttpDownInfo) Paths(java.nio.file.Paths) ConfigForm(lee.study.down.mvc.form.ConfigForm) HttpDownUtil(lee.study.down.util.HttpDownUtil) StringUtils(org.springframework.util.StringUtils) DirInfo(lee.study.down.model.DirInfo) ResultInfo(lee.study.down.model.ResultInfo) File(java.io.File) LinkedList(java.util.LinkedList) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 8 with Files

use of java.nio.file.Files in project felix by apache.

the class Posix method less.

protected void less(CommandSession session, Process process, String[] argv) throws Exception {
    String[] usage = { "less -  file pager", "Usage: less [OPTIONS] [FILES]", "  -? --help                    Show help", "  -e --quit-at-eof             Exit on second EOF", "  -E --QUIT-AT-EOF             Exit on EOF", "  -F --quit-if-one-screen      Exit if entire file fits on first screen", "  -q --quiet --silent          Silent mode", "  -Q --QUIET --SILENT          Completely  silent", "  -S --chop-long-lines         Do not fold long lines", "  -i --ignore-case             Search ignores lowercase case", "  -I --IGNORE-CASE             Search ignores all case", "  -x --tabs                    Set tab stops", "  -N --LINE-NUMBERS            Display line number for each line", "     --no-init                 Disable terminal initialization", "     --no-keypad               Disable keypad handling" };
    boolean hasExtendedOptions = false;
    try {
        Less.class.getField("quitIfOneScreen");
        hasExtendedOptions = true;
    } catch (NoSuchFieldException e) {
        List<String> ustrs = new ArrayList<>(Arrays.asList(usage));
        ustrs.removeIf(s -> s.contains("--quit-if-one-screen") || s.contains("--no-init") || s.contains("--no-keypad"));
        usage = ustrs.toArray(new String[ustrs.size()]);
    }
    Options opt = parseOptions(session, usage, argv);
    List<Source> sources = new ArrayList<>();
    if (opt.args().isEmpty()) {
        opt.args().add("-");
    }
    for (String arg : opt.args()) {
        if ("-".equals(arg)) {
            sources.add(new StdInSource(process));
        } else {
            sources.add(new PathSource(session.currentDir().resolve(arg), arg));
        }
    }
    if (!process.isTty(1)) {
        for (Source source : sources) {
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(source.read()))) {
                cat(process, reader, opt.isSet("LINE-NUMBERS"));
            }
        }
        return;
    }
    Less less = new Less(Shell.getTerminal(session));
    less.quitAtFirstEof = opt.isSet("QUIT-AT-EOF");
    less.quitAtSecondEof = opt.isSet("quit-at-eof");
    less.quiet = opt.isSet("quiet");
    less.veryQuiet = opt.isSet("QUIET");
    less.chopLongLines = opt.isSet("chop-long-lines");
    less.ignoreCaseAlways = opt.isSet("IGNORE-CASE");
    less.ignoreCaseCond = opt.isSet("ignore-case");
    if (opt.isSet("tabs")) {
        less.tabs = opt.getNumber("tabs");
    }
    less.printLineNumbers = opt.isSet("LINE-NUMBERS");
    if (hasExtendedOptions) {
        Less.class.getField("quitIfOneScreen").set(less, opt.isSet("quit-if-one-screen"));
        Less.class.getField("noInit").set(less, opt.isSet("no-init"));
        Less.class.getField("noKeypad").set(less, opt.isSet("no-keypad"));
    }
    less.run(sources);
}
Also used : Arrays(java.util.Arrays) PathSource(org.jline.builtins.Source.PathSource) Date(java.util.Date) ZonedDateTime(java.time.ZonedDateTime) IntConsumer(java.util.function.IntConsumer) FileTime(java.nio.file.attribute.FileTime) IntBinaryOperator(java.util.function.IntBinaryOperator) CommandSession(org.apache.felix.service.command.CommandSession) AttributedString(org.jline.utils.AttributedString) WatchKey(java.nio.file.WatchKey) Matcher(java.util.regex.Matcher) ByteArrayInputStream(java.io.ByteArrayInputStream) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Context(org.apache.felix.gogo.jline.Shell.Context) Path(java.nio.file.Path) EnumSet(java.util.EnumSet) Options(org.jline.builtins.Options) TTop(org.jline.builtins.TTop) PosixFilePermission(java.nio.file.attribute.PosixFilePermission) Predicate(java.util.function.Predicate) Set(java.util.Set) Source(org.jline.builtins.Source) Reader(java.io.Reader) Instant(java.time.Instant) OSUtils(org.jline.utils.OSUtils) Collectors(java.util.stream.Collectors) ZoneId(java.time.ZoneId) Executors(java.util.concurrent.Executors) Objects(java.util.Objects) List(java.util.List) Stream(java.util.stream.Stream) Pattern(java.util.regex.Pattern) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Capability(org.jline.utils.InfoCmp.Capability) Commands(org.jline.builtins.Commands) SimpleDateFormat(java.text.SimpleDateFormat) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Attributes(org.jline.terminal.Attributes) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Process(org.apache.felix.service.command.Process) LinkOption(java.nio.file.LinkOption) FilterInputStream(java.io.FilterInputStream) StandardWatchEventKinds(java.nio.file.StandardWatchEventKinds) PosixFilePermissions(java.nio.file.attribute.PosixFilePermissions) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Nano(org.jline.builtins.Nano) Terminal(org.jline.terminal.Terminal) OutputStream(java.io.OutputStream) PrintStream(java.io.PrintStream) CommandProcessor(org.apache.felix.service.command.CommandProcessor) AttributedStyle(org.jline.utils.AttributedStyle) Files(java.nio.file.Files) IOException(java.io.IOException) InputStreamReader(java.io.InputStreamReader) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) WatchService(java.nio.file.WatchService) TreeMap(java.util.TreeMap) AttributedStringBuilder(org.jline.utils.AttributedStringBuilder) Closeable(java.io.Closeable) DateTimeFormatter(java.time.format.DateTimeFormatter) BufferedReader(java.io.BufferedReader) Comparator(java.util.Comparator) Less(org.jline.builtins.Less) Collections(java.util.Collections) InputStream(java.io.InputStream) Options(org.jline.builtins.Options) InputStreamReader(java.io.InputStreamReader) PathSource(org.jline.builtins.Source.PathSource) ArrayList(java.util.ArrayList) AttributedString(org.jline.utils.AttributedString) PathSource(org.jline.builtins.Source.PathSource) Source(org.jline.builtins.Source) BufferedReader(java.io.BufferedReader) List(java.util.List) ArrayList(java.util.ArrayList) Less(org.jline.builtins.Less)

Example 9 with Files

use of java.nio.file.Files in project tezcRaft by tezc.

the class Cluster method openStores.

/**
 * Open stores
 *
 * Called prior to open a cluster. This method reads cluster log from
 * file storage if exists.
 *
 * @throws IOException on any IO error
 */
private void openStores() throws IOException {
    List<Path> paths = Files.walk(path).filter(Files::isRegularFile).filter(p -> p.toString().endsWith(".store")).collect(Collectors.toList());
    List<MappedStore> tmp = new ArrayList<>();
    for (Path path : paths) {
        try {
            MappedStore store = new MappedStore(worker, path, storeSize);
            /*
                 * This could happen on an race condition, store was created
                 * just before used first time. So, this store does not contain
                 * any data, we simply delete it.
                 */
            if (store.getBaseIndex() == -1) {
                store.delete();
                worker.logWarn("Inconsistent " + "log file is deleted", store.getPath());
                continue;
            }
            tmp.add(store);
        } catch (Exception e) {
            worker.logError(e);
        }
    }
    /*
         * Store files should be sequential, if we detect files out of other,
         * sequential ones will be kept, rest will be deleted. As we will start
         * as follower, leader will send us the missing log anyway.
         */
    tmp.sort(Comparator.comparingLong(MappedStore::getBaseIndex));
    for (int i = 1; i < tmp.size(); i++) {
        long base = tmp.get(i).getBaseIndex();
        long prevEnd = tmp.get(i - 1).getEndIndex();
        if (base != prevEnd + 1) {
            List<MappedStore> sub = tmp.subList(i, tmp.size());
            sub.forEach(store -> {
                try {
                    store.delete();
                    worker.logWarn("Inconsistent " + "log file is deleted", store.getPath());
                } catch (Exception e) {
                    worker.logError(e);
                }
            });
            sub.clear();
            break;
        }
    }
    /*
         * First log store must match with the snapshot index, if not, store
         * files are inconsistent(in case of a race condition, manual log file
         * deletion etc..)
         *
         * As we will start
         * as follower, leader will send us the missing log anyway.
         */
    if (tmp.size() > 0 && tmp.get(0).getBaseIndex() != snapshotIndex + 1) {
        tmp.forEach(store -> {
            try {
                store.delete();
                worker.logWarn("Inconsistent " + "log file is deleted", store.getPath());
            } catch (Exception e) {
                worker.logError(e);
            }
        });
        tmp.clear();
    }
    stores.addAll(tmp);
}
Also used : Path(java.nio.file.Path) java.util(java.util) Core(tezc.core.Core) TransportRecord(tezc.core.record.TransportRecord) ClusterWorker(tezc.core.worker.clusterworker.ClusterWorker) TakeSnapshotEvent(tezc.core.worker.clusterworker.TakeSnapshotEvent) ByteBuffer(java.nio.ByteBuffer) NodeRecord(tezc.core.record.NodeRecord) Buffer(tezc.base.common.Buffer) ConfigCommand(tezc.core.cluster.state.command.ConfigCommand) IncomingConnEvent(tezc.core.node.IncomingConnEvent) Path(java.nio.file.Path) Command(tezc.core.cluster.state.command.Command) Files(java.nio.file.Files) RegisterCommand(tezc.core.cluster.state.command.RegisterCommand) ClusterRecord(tezc.core.record.ClusterRecord) StandardOpenOption(java.nio.file.StandardOpenOption) IOException(java.io.IOException) Connection(tezc.core.connection.Connection) Collectors(java.util.stream.Collectors) UncheckedIOException(java.io.UncheckedIOException) RaftState(tezc.core.cluster.state.RaftState) Paths(java.nio.file.Paths) PeerNode(tezc.core.node.PeerNode) Worker(tezc.core.worker.Worker) RaftException(tezc.base.exception.RaftException) State(tezc.State) tezc.core.msg(tezc.core.msg) NoOPCommand(tezc.core.cluster.state.command.NoOPCommand) FileChannel(java.nio.channels.FileChannel) Files(java.nio.file.Files) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) RaftException(tezc.base.exception.RaftException)

Example 10 with Files

use of java.nio.file.Files in project nifi by apache.

the class TestListFile method testFilterAge.

@Test
public void testFilterAge() throws Exception {
    final File file1 = new File(TESTDIR + "/age1.txt");
    assertTrue(file1.createNewFile());
    final File file2 = new File(TESTDIR + "/age2.txt");
    assertTrue(file2.createNewFile());
    final File file3 = new File(TESTDIR + "/age3.txt");
    assertTrue(file3.createNewFile());
    final Function<Boolean, Object> runNext = resetAges -> {
        if (resetAges) {
            resetAges();
            assertTrue(file1.setLastModified(time0millis));
            assertTrue(file2.setLastModified(time2millis));
            assertTrue(file3.setLastModified(time4millis));
        }
        try {
            runNext();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return null;
    };
    // check all files
    runner.setProperty(ListFile.DIRECTORY, testDir.getAbsolutePath());
    runNext.apply(true);
    runner.assertTransferCount(ListFile.REL_SUCCESS, 3);
    // processor updates internal state, it shouldn't pick the same ones.
    runNext.apply(false);
    runner.assertTransferCount(ListFile.REL_SUCCESS, 0);
    // exclude oldest
    runner.setProperty(ListFile.MIN_AGE, age0);
    runner.setProperty(ListFile.MAX_AGE, age3);
    runNext.apply(true);
    runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS);
    final List<MockFlowFile> successFiles2 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS);
    assertEquals(2, successFiles2.size());
    assertEquals(file2.getName(), successFiles2.get(0).getAttribute("filename"));
    assertEquals(file1.getName(), successFiles2.get(1).getAttribute("filename"));
    // exclude newest
    runner.setProperty(ListFile.MIN_AGE, age1);
    runner.setProperty(ListFile.MAX_AGE, age5);
    runNext.apply(true);
    runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS);
    final List<MockFlowFile> successFiles3 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS);
    assertEquals(2, successFiles3.size());
    assertEquals(file3.getName(), successFiles3.get(0).getAttribute("filename"));
    assertEquals(file2.getName(), successFiles3.get(1).getAttribute("filename"));
    // exclude oldest and newest
    runner.setProperty(ListFile.MIN_AGE, age1);
    runner.setProperty(ListFile.MAX_AGE, age3);
    runNext.apply(true);
    runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS);
    final List<MockFlowFile> successFiles4 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS);
    assertEquals(1, successFiles4.size());
    assertEquals(file2.getName(), successFiles4.get(0).getAttribute("filename"));
}
Also used : Arrays(java.util.Arrays) FileInfo(org.apache.nifi.processors.standard.util.FileInfo) SimpleDateFormat(java.text.SimpleDateFormat) HashMap(java.util.HashMap) Function(java.util.function.Function) PropertyDescriptor(org.apache.nifi.components.PropertyDescriptor) ArrayList(java.util.ArrayList) Scope(org.apache.nifi.components.state.Scope) Relationship(org.apache.nifi.processor.Relationship) TestRunner(org.apache.nifi.util.TestRunner) Locale(java.util.Locale) Map(java.util.Map) Path(java.nio.file.Path) DateFormat(java.text.DateFormat) Before(org.junit.Before) FlowFile(org.apache.nifi.flowfile.FlowFile) FileStore(java.nio.file.FileStore) Files(java.nio.file.Files) Assert.assertNotNull(org.junit.Assert.assertNotNull) ProcessContext(org.apache.nifi.processor.ProcessContext) Assert.assertTrue(org.junit.Assert.assertTrue) FileOutputStream(java.io.FileOutputStream) Set(java.util.Set) IOException(java.io.IOException) Test(org.junit.Test) Description(org.junit.runner.Description) Collectors(java.util.stream.Collectors) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) AbstractListProcessor(org.apache.nifi.processor.util.list.AbstractListProcessor) Rule(org.junit.Rule) Optional(java.util.Optional) CoreAttributes(org.apache.nifi.flowfile.attributes.CoreAttributes) ListProcessorTestWatcher(org.apache.nifi.processor.util.list.ListProcessorTestWatcher) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) TestRunners(org.apache.nifi.util.TestRunners) MockFlowFile(org.apache.nifi.util.MockFlowFile) MockFlowFile(org.apache.nifi.util.MockFlowFile) FlowFile(org.apache.nifi.flowfile.FlowFile) File(java.io.File) MockFlowFile(org.apache.nifi.util.MockFlowFile) Test(org.junit.Test)

Aggregations

Files (java.nio.file.Files)247 IOException (java.io.IOException)213 Path (java.nio.file.Path)199 List (java.util.List)177 Collectors (java.util.stream.Collectors)157 Paths (java.nio.file.Paths)135 File (java.io.File)130 ArrayList (java.util.ArrayList)117 Map (java.util.Map)111 Set (java.util.Set)97 Collections (java.util.Collections)89 Arrays (java.util.Arrays)81 Stream (java.util.stream.Stream)78 HashMap (java.util.HashMap)75 HashSet (java.util.HashSet)58 InputStream (java.io.InputStream)56 Collection (java.util.Collection)55 Logger (org.slf4j.Logger)54 Pattern (java.util.regex.Pattern)53 Optional (java.util.Optional)51