8 |
|
|
9 |
|
#include "Share.hpp" |
10 |
|
|
11 |
< |
Share::Share(const _R<dbi::Connection>& connection, const api::Address& host, const cse::String& share) : connection(connection), host(host), share(share) |
11 |
> |
Share::Share(const _R<dbi::Connection>& connection, const api::InternetAddress& host, const cse::String& share) : connection(connection), host(host), share(share) |
12 |
|
{ |
13 |
– |
api::Path shares(_B("Shares")); |
14 |
– |
|
15 |
– |
if (!shares.Exists()) |
16 |
– |
shares.CreateDirectory(); |
17 |
– |
|
13 |
|
cse::String address, port; |
14 |
|
|
15 |
|
host.ToString(address, port); |
16 |
|
|
17 |
< |
api::Path host_(shares.GetRealPath().GetChild(address)); |
17 |
> |
api::Path host_(shares.GetChild(address)); |
18 |
|
|
19 |
|
if (!host_.Exists()) |
20 |
|
host_.CreateDirectory(); |
29 |
|
{ |
30 |
|
connection->Parse(_B("UPDATE files SET live = FALSE WHERE root = ?"))->Execute(path.GetPath()); |
31 |
|
} |
32 |
+ |
|
33 |
+ |
api::Path Share::shares(_B("Shares")); |