2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 * @file Attachment.cpp
20 * @author Pawel Misiak (p.misiak@samsung.com)
25 #include <dpl/log/log.h>
26 #include <Commons/Exception.h>
27 #include <Filesystem/Manager.h>
28 #include "Attachment.h"
30 #include <API/Filesystem/INode.h>
31 #include <Tizen/Filesystem/EventGetNodeData.h>
32 #include <API/Filesystem/IManager.h>
39 using namespace WrtDeviceApis::Commons;
42 //--------------------------------------------------------------------------
47 Attachment::Attachment(const string& fullPath,
51 init(fullPath, isVirtualPath);
54 Attachment::Attachment(emf_attachment_info_t* att)
58 m_attachShortName = std::string(att->name); //set shot Name
59 m_isDownloaded = att->downloaded;
60 m_attachmentID = att->attachment_id;
62 LogDebug(" showname = " << m_attachShortName << " isDownloaded = " << m_isDownloaded << " attachmentID = " << m_attachmentID);
63 LogDebug("save name is = " << att->savename);
66 init( att->savename, false);
71 Attachment::Attachment(const std::string& fullPath, bool isVirtualPath,
72 const Api::Filesystem::INode& inode):
73 Api::Filesystem::INode(inode)
75 LogDebug("entered , inode");
76 init(fullPath, isVirtualPath);
81 Attachment::Attachment(const std::string& fullPath, bool isVirtualPath, const Api::Filesystem::INode& inode):
84 LogDebug("entered , inode");
85 init(fullPath, isVirtualPath);
89 std::string Attachment::getRealPath(const std::string &path) const
91 #if 0 // MESSAGING ATTACHMENT IS BLOCKED
94 Api::Filesystem::IPathPtr currentPath = Api::Filesystem::IPath::create(
96 return currentPath->getFullPath();
99 Catch(WrtDeviceApis::Commons::Exception) {
100 LogError("invalid path");
101 ReThrow(WrtDeviceApis::Commons::InvalidArgumentException);