diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/store/FileStoreRemote.java b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/store/FileStoreRemote.java index 019cf289268ccc891b51957ed62fa12c688018d8..cf0d88c50ea0d5bf2ab443033c4186884daed9b2 100644 --- a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/store/FileStoreRemote.java +++ b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/store/FileStoreRemote.java @@ -24,6 +24,7 @@ import ch.systemsx.cisd.common.exceptions.NotImplementedException; import ch.systemsx.cisd.common.exceptions.Status; import ch.systemsx.cisd.common.highwatermark.FileWithHighwaterMark; import ch.systemsx.cisd.common.highwatermark.HighwaterMarkWatcher; +import ch.systemsx.cisd.common.highwatermark.RemoteFreeSpaceProvider; import ch.systemsx.cisd.common.logging.ISimpleLogger; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; @@ -32,7 +33,6 @@ import ch.systemsx.cisd.datamover.filesystem.intf.FileStore; import ch.systemsx.cisd.datamover.filesystem.intf.IExtendedFileStore; import ch.systemsx.cisd.datamover.filesystem.intf.IFileSysOperationsFactory; import ch.systemsx.cisd.datamover.filesystem.intf.IStoreCopier; -import ch.systemsx.cisd.datamover.utils.RemoteFreeSpaceProvider; /** * @author Tomasz Pylak diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/utils/RemoteFreeSpaceProvider.java b/datamover/source/java/ch/systemsx/cisd/datamover/utils/RemoteFreeSpaceProvider.java deleted file mode 100644 index 7ef9a2b99009bb678a8a75ae2e0c344927cd314a..0000000000000000000000000000000000000000 --- a/datamover/source/java/ch/systemsx/cisd/datamover/utils/RemoteFreeSpaceProvider.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2008 ETH Zuerich, CISD - * - * Licensed 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 ch.systemsx.cisd.datamover.utils; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - -import org.apache.log4j.Logger; - -import ch.systemsx.cisd.common.highwatermark.HighwaterMarkWatcher.IFreeSpaceProvider; -import ch.systemsx.cisd.common.process.ProcessExecutionHelper; -import ch.systemsx.cisd.common.process.ProcessResult; - -/** - * An <code>IFreeSpaceProvider</code> implementation for computing the free space on a remote - * computer. - * - * @author Christian Ribeaud - */ -public final class RemoteFreeSpaceProvider implements IFreeSpaceProvider -{ - private final File sshExecutable; - - private final String host; - - public RemoteFreeSpaceProvider(final String host, final File sshExecutable) - { - this.host = host; - this.sshExecutable = sshExecutable; - } - - // - // IFreeSpaceProvider - // - - public final long freeSpaceKb(final File path) throws IOException - { - final List<String> command = - Arrays.asList(sshExecutable.getPath(), host, "df -k " + path.getPath() + ""); - Logger rootLogger = Logger.getRootLogger(); - System.out.println(command); - final ProcessResult processResult = - ProcessExecutionHelper.run(command, 2000L, rootLogger, rootLogger); - System.out.println(processResult.getProcessOutput()); - return 0L; - } -} \ No newline at end of file diff --git a/datamover/sourceTest/java/ch/systemsx/cisd/datamover/utils/RemoteFreeSpaceProviderTest.java b/datamover/sourceTest/java/ch/systemsx/cisd/datamover/utils/RemoteFreeSpaceProviderTest.java deleted file mode 100644 index fe83da17e08991bc6ec236a590ee0a4d9939e283..0000000000000000000000000000000000000000 --- a/datamover/sourceTest/java/ch/systemsx/cisd/datamover/utils/RemoteFreeSpaceProviderTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2008 ETH Zuerich, CISD - * - * Licensed 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 ch.systemsx.cisd.datamover.utils; - -import static org.testng.AssertJUnit.assertNotNull; - -import java.io.File; -import java.io.IOException; - -import org.testng.annotations.Test; - -import ch.systemsx.cisd.common.utilities.OSUtilities; - -/** - * Test cases for {@link RemoteFreeSpaceProvider}. - * - * @author Christian Ribeaud - */ -public final class RemoteFreeSpaceProviderTest -{ - - @Test(groups = "broken") - public final void testFreeSpaceKb() throws IOException - { - final File sshExecutable = OSUtilities.findExecutable("ssh"); - assertNotNull(sshExecutable); - final RemoteFreeSpaceProvider freeSpaceProvider = - new RemoteFreeSpaceProvider("sprint-ob", sshExecutable); - System.out.println(freeSpaceProvider.freeSpaceKb(new File("/"))); - } -}