james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [04/17] james-project git commit: JAMES-2436 Add a Directory type extending file to create folder in archive without handling real folders
Date Wed, 27 Jun 2018 14:44:26 GMT
JAMES-2436 Add a Directory type extending file to create folder in archive without handling
real folders


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/9be830a4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/9be830a4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/9be830a4

Branch: refs/heads/master
Commit: 9be830a47a2e28d055132cbb143b035b63046fbd
Parents: 0ebd232
Author: Raphael Ouazana <raphael.ouazana@linagora.com>
Authored: Tue Jun 19 17:27:37 2018 +0200
Committer: Raphael Ouazana <raphael.ouazana@linagora.com>
Committed: Wed Jun 27 16:36:12 2018 +0200

----------------------------------------------------------------------
 .../apache/james/mailbox/backup/Directory.java  | 33 ++++++++++++++++++++
 .../james/mailbox/backup/DirectoryTest.java     | 31 ++++++++++++++++++
 2 files changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/9be830a4/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Directory.java
----------------------------------------------------------------------
diff --git a/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Directory.java b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Directory.java
new file mode 100644
index 0000000..e1e4196
--- /dev/null
+++ b/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/Directory.java
@@ -0,0 +1,33 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.backup;
+
+import java.io.File;
+
+public class Directory extends File {
+
+    public Directory(String pathname) {
+        super(pathname);
+    }
+
+    @Override
+    public boolean isDirectory() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/9be830a4/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DirectoryTest.java
----------------------------------------------------------------------
diff --git a/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DirectoryTest.java
b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DirectoryTest.java
new file mode 100644
index 0000000..01620e2
--- /dev/null
+++ b/mailbox/backup/src/test/java/org/apache/james/mailbox/backup/DirectoryTest.java
@@ -0,0 +1,31 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.backup;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+public class DirectoryTest {
+
+    @Test
+    void isDirectoryShouldReturnTrue() {
+        assertThat(new Directory("myPath").isDirectory()).isTrue();
+    }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message