// Path: src/main/java/com/yet/dsync/exception/DSyncClientException.java
// public class DSyncClientException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public DSyncClientException(final String message) {
//         super(message);
//     }
// 
//     public DSyncClientException(final Throwable cause) {
//         super(cause);
//     }
// 
//     public DSyncClientException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     public DSyncClientException(final String message, final Throwable cause,
//                                 final boolean enableSuppression, final boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
// 
// }


import com.yet.dsync.exception.DSyncClientException;
import java.nio.file.Path;
import java.nio.file.StandardWatchEventKinds;
import java.nio.file.WatchEvent.Kind;

/*
 * Copyright (c) 2017 Yuriy Tkach
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package com.yet.dsync.dto;



public enum LocalFolderChangeType {

    CREATE,

    MODIFY,

    DELETE;

    public static LocalFolderChangeType fromWatchEventKind(final Kind<Path> watchEventKind) {
        if (watchEventKind == StandardWatchEventKinds.ENTRY_CREATE) {
            return CREATE;

        } else if (watchEventKind == StandardWatchEventKinds.ENTRY_MODIFY) {
            return MODIFY;

        } else if (watchEventKind == StandardWatchEventKinds.ENTRY_DELETE) {
            return DELETE;

        } else {

// Path: src/main/java/com/yet/dsync/exception/DSyncClientException.java
// public class DSyncClientException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public DSyncClientException(final String message) {
//         super(message);
//     }
// 
//     public DSyncClientException(final Throwable cause) {
//         super(cause);
//     }
// 
//     public DSyncClientException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     public DSyncClientException(final String message, final Throwable cause,
//                                 final boolean enableSuppression, final boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
// 
// }


// Path: src/main/java/com/yet/dsync/dto/LocalFolderChangeType.java
import com.yet.dsync.exception.DSyncClientException;
import java.nio.file.Path;
import java.nio.file.StandardWatchEventKinds;
import java.nio.file.WatchEvent.Kind;

/*
 * Copyright (c) 2017 Yuriy Tkach
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package com.yet.dsync.dto;



public enum LocalFolderChangeType {

    CREATE,

    MODIFY,

    DELETE;

    public static LocalFolderChangeType fromWatchEventKind(final Kind<Path> watchEventKind) {
        if (watchEventKind == StandardWatchEventKinds.ENTRY_CREATE) {
            return CREATE;

        } else if (watchEventKind == StandardWatchEventKinds.ENTRY_MODIFY) {
            return MODIFY;

        } else if (watchEventKind == StandardWatchEventKinds.ENTRY_DELETE) {
            return DELETE;

        } else {

            throw new DSyncClientException("Unsupported watchEventKind " + watchEventKind);
