summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/NodeI.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-04-04 04:27:08 +0000
committerMarc Laukien <marc@zeroc.com>2002-04-04 04:27:08 +0000
commit30782d480a0f5f732175dd22f49b56a013eb5fe6 (patch)
treeb21d673e83ed0a6d48bfef34a32a9b7e73835992 /cpp/src/IcePatch/NodeI.cpp
parentmore IcePatch stuff (diff)
downloadice-30782d480a0f5f732175dd22f49b56a013eb5fe6.tar.bz2
ice-30782d480a0f5f732175dd22f49b56a013eb5fe6.tar.xz
ice-30782d480a0f5f732175dd22f49b56a013eb5fe6.zip
more IcePatch stuff
Diffstat (limited to 'cpp/src/IcePatch/NodeI.cpp')
-rw-r--r--cpp/src/IcePatch/NodeI.cpp38
1 files changed, 26 insertions, 12 deletions
diff --git a/cpp/src/IcePatch/NodeI.cpp b/cpp/src/IcePatch/NodeI.cpp
index e5b39645ed4..d0c8635b456 100644
--- a/cpp/src/IcePatch/NodeI.cpp
+++ b/cpp/src/IcePatch/NodeI.cpp
@@ -9,6 +9,7 @@
// **********************************************************************
#include <IcePatch/NodeI.h>
+#include <IcePatch/NodeUtil.h>
#include <dirent.h>
using namespace std;
@@ -91,22 +92,33 @@ IcePatch::DirectoryI::getContents(const Ice::Current& current)
{
string name = namelist[i]->d_name;
- if (name != ".." && name != ".")
+ if (name == ".." || name == ".")
{
- identity.name = path + '/' + name;
- NodePrx node = NodePrx::uncheckedCast(_adapter->createProxy(identity));
- try
- {
- result.push_back(node->describe());
- }
- catch (const ObjectNotExistException&)
+ continue;
+ }
+
+ string::size_type pos;
+ if ((pos = name.rfind(".md5")) != string::npos)
+ {
+ if (name.size() == pos + 4)
{
- //
- // Ignore. This can for example happen if the node
- // locator cannot call stat() on the file.
- //
+ continue;
}
}
+
+ identity.name = path + '/' + name;
+ NodePrx node = NodePrx::uncheckedCast(_adapter->createProxy(identity));
+ try
+ {
+ result.push_back(node->describe());
+ }
+ catch (const ObjectNotExistException&)
+ {
+ //
+ // Ignore. This can for example happen if the node
+ // locator cannot call stat() on the file.
+ //
+ }
}
for (i = 0; i < n; ++i)
@@ -140,6 +152,8 @@ IcePatch::FileI::describe(const Ice::Current& current)
{
FileDescPtr desc = new FileDesc;
desc->file = FilePrx::uncheckedCast(_adapter->createProxy(current.identity));
+ string path = normalizePath(current.identity.name);
+ desc->md5 = getMD5(path);
return desc;
}