Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
Update #202
Browse files Browse the repository at this point in the history
  • Loading branch information
hdsdi3g committed Nov 9, 2016
1 parent 80ba9bf commit 580954a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/hd3gtv/mydmam/storage/IgnoreFiles.java
Expand Up @@ -22,6 +22,9 @@ public abstract class IgnoreFiles {

public abstract boolean isDirNameIsAllowed(String dirname);

/**
* All but *.lnk files
*/
public static IgnoreFiles default_list = new IgnoreFiles() {

public boolean isFileNameIsAllowed(String filename) {
Expand All @@ -36,6 +39,9 @@ public boolean isDirNameIsAllowed(String dirname) {
}
};

/**
* All but .lnk desktop.ini .DS_Store .localized .Icon Thumbs.db
*/
public static IgnoreFiles directory_config_list = new IgnoreFiles() {

public boolean isFileNameIsAllowed(String filename) {
Expand Down
8 changes: 5 additions & 3 deletions app/hd3gtv/mydmam/storage/StorageSMB.java
Expand Up @@ -34,16 +34,18 @@ public class StorageSMB extends StorageURILoginPassword {

StorageSMB(URILoginPasswordConfiguration configuration) {
super(configuration);
auth = new NtlmPasswordAuthentication("", configuration.login, configuration.password);
if (configuration.domain == null) {
auth = new NtlmPasswordAuthentication("", configuration.login, configuration.password);
} else {
auth = new NtlmPasswordAuthentication(configuration.domain, configuration.login, configuration.password);
}

StringBuffer sb = new StringBuffer();
sb.append("smb://");
sb.append(configuration.host);
sb.append(configuration.relative_path);
sb.append("/");
root_path = sb.toString();
/*
configuration.relative_path = file.getPath();*/
}

class AbstractFileSmb implements AbstractFile {
Expand Down
8 changes: 8 additions & 0 deletions app/hd3gtv/mydmam/storage/URILoginPasswordConfiguration.java
Expand Up @@ -27,6 +27,7 @@ final class URILoginPasswordConfiguration {
String host;
int port;
String relative_path;
String domain;

URILoginPasswordConfiguration(String configuration_path, LinkedHashMap<String, ?> optional_storage_def) {
int pos_colon = configuration_path.indexOf(":");
Expand Down Expand Up @@ -72,6 +73,9 @@ final class URILoginPasswordConfiguration {
if (optional_storage_def.containsKey("password")) {
password = (String) optional_storage_def.get("password");
}
if (optional_storage_def.containsKey("domain")) {
domain = (String) optional_storage_def.get("domain");
}
}

public String toString() {
Expand All @@ -83,6 +87,10 @@ private String toURI(boolean show_passwords) {
sb.append(type);
sb.append("://");
if (login != null) {
if (domain != null) {
sb.append(domain);
sb.append("\\");
}
sb.append(login);
if (password != null) {
sb.append(":");
Expand Down
1 change: 1 addition & 0 deletions conf/app.d-examples/storage.yml.example
Expand Up @@ -7,6 +7,7 @@ storage:
# or path: ftp_passive://user:password@host/dest/path/to/go
# with file, ftp_passive, ftp_active, smb, ftp_broadcastserver
# password: A:Spec:alP:ssword
# domain: my-ad-domain.network # Set AD Windows domain, only for SMB access.
regular_indexing: true # set to false for just declare a storage.
period: 600 # in seconds: if regular_indexing, it will index this storage regulary, else period will help to calculate the ttl for pushing in database.
# mounted: /Volumes/host/dest/path/to/go # if you want the local tools, like ffmpeg or ImageMagick can access to a distant file, you can mount it in local.
Expand Down

0 comments on commit 580954a

Please sign in to comment.