Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vachounet/swiftlib_hubic
Modded SwiftLib to work with Hubic.com
https://github.com/vachounet/swiftlib_hubic
Last synced: 4 days ago
JSON representation
Modded SwiftLib to work with Hubic.com
- Host: GitHub
- URL: https://github.com/vachounet/swiftlib_hubic
- Owner: Vachounet
- Created: 2015-04-10T08:29:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-15T14:15:33.000Z (over 9 years ago)
- Last Synced: 2023-03-21T03:41:29.033Z (almost 2 years ago)
- Language: C#
- Size: 203 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
SwiftLib_Hubic
==============
Modded SwiftLib to work with [Hubic.com](https://hubic.com)----------
***Log4Net is needed***
----------
You first need a swift proxy for hubic. Ex.: [Hubic2SwiftGate](https://github.com/oderwat/hubic2swiftgate)
This proxy will be the entry point to get a Hubic connection token and Hubic URL to perform calls.Needed key in .config :
Code :
static SwiftConfig cfg = new SwiftConfig();
static SwiftClient client;
private static void InitConfig()
{
cfg.Url = System.Configuration.ConfigurationManager.AppSettings.Get("SwiftUrl");
cfg.User = System.Configuration.ConfigurationManager.AppSettings.Get("User");
cfg.Authkey = System.Configuration.ConfigurationManager.AppSettings.Get("AuthKey");
cfg.BoxFolder = System.Configuration.ConfigurationManager.AppSettings.Get("BoxFolder");
cfg.DownloadFolder = System.Configuration.ConfigurationManager.AppSettings.Get("DownloadFolder");
}// build Swift client using the authentication
// information in the configuration file
public static void BuildClient()
{
if (client == null || !client.IsAuthenticated())
{
client = new SwiftClient(cfg);
}
}
----------
Create object
client.CreateObject(hubic_container, filename, "", local_file_path);
----------
Create container
client.CreateContainer(path);
----------
Delete container/object
client.DeleteContainer(path);
----------
Get objects/containers list
client.GetObjectListAsObject(path, true/false);
----------
If you have issues uploading large files, try increasing executionTimeout & maxRequestLength.
Ex.: