Find Jobs
Hire Freelancers

DirectoryWatcher

$100-150 USD

Concluído
Publicado há mais de 12 anos

$100-150 USD

Pago na entrega
A directory monitoring class. When a certain type of file is created, it is "locked" and read, passed to another class and then deleted. Please read the attached documents carefully before bidding. ## Deliverables ### DirectoryWatcher Namespace: [login to view URL] Overview This is a class that invokes a RuleEngine (re) whenever a file is created in a directory. There may be multiple directories being watched and there may be multiple applications, on different machines, watching the same directories. When a file in a directory changes the file is read and the RulesEngine is invoked. A call to beginWatching will start the process of watching the directories. Processing is done in the single thread, as user intervention may be required. **Details** An xml configuration file will determine the rules. The configuration file will be located at [login to view URL] + "[\\[login to view URL]][1]". The class constructor will load it. The structure will be: <rules> <ruleset directoryName="...." /> <ruleset directoryName="...." /> .... </rules> An xml configuration file ([login to view URL]) will have 'ruleset' nodes with an attribute of 'directoryName'. The method beginWatching() should read the configuration file and watch every directory referenced for changed files. When a file has been changed first verify that the extension of the file is CSV then verify that there is no file of the same name with a "lock" extension. Then write a lock file into the directory, catering for race conditions. If successful, the ruleset node matching the directory that has the modified file needs to be found within the xml file i.e. .selectSingleNode("//ruleset[@directoryName='directory']". An object (re) of type RuleEngine (namespace AgentMangler) is created passing the ruleset to the constructor and the method: Public void [login to view URL](stream csvData) Is called. When the method completes the file is to be moved to the Done folder (as specified as an attribute on the ruleset) and the lock file removed. The process method may throw an InvalidEntity error in which case the original file is moved to a designated errors folder (attribute errorFolder) and the lock file removed. An email is then sent out to a predesignated email address. The To: email address will be an attribute (errorEmail) on the ruleset The From: email address will be an attribute (email) on the rules.documentElement. The SMTP server will be an attribute (smtp) on the rules.documentElement. The subject should be "Error parsing file" The body should contain the record number (+1) of the toBeProcessed object that failed and the file name. Simple email code shown below: [login to view URL] message = new [login to view URL](); [login to view URL]("[luckyperson@[login to view URL]][2]"); [login to view URL] = "This is the Subject line"; [login to view URL] = new [login to view URL]("[From@[login to view URL]][3]"); [login to view URL] = "This is the message body"; [login to view URL] smtp = new [login to view URL]("yoursmtphost"); [login to view URL](message); # Scope The class [login to view URL] is required. Unit tests in [login to view URL] The unit test should verify the functionality of : * Monitoring a directory * Finding, and passing, the correct ruleset node * The full file locking process * emails The class Config will be mocked for the unit test The class RuleEngine will be mocked for the unit test The mocked objects should be located in a separate file [login to view URL]
ID do Projeto: 3661625

Sobre o projeto

4 propostas
Projeto remoto
Ativo há 12 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$125 USD em 14 dias
5,0 (54 avaliações)
5,4
5,4
4 freelancers estão ofertando em média $114 USD for esse trabalho
Avatar do Usuário
See private message.
$120,70 USD em 14 dias
4,6 (48 avaliações)
6,0
6,0
Avatar do Usuário
See private message.
$85 USD em 14 dias
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
See private message.
$125,80 USD em 14 dias
0,0 (2 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) AUSTRALIA
Australia
5,0
24
Método de pagamento verificado
Membro desde mar. 1, 2006

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.