Created
June 17, 2016 03:00
-
-
Save douglascrp/89c2a85d3a255f598359931886faeea2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Criação de pasta com CURL | |
# | |
# Usage: cria_pasta_nativa.sh | |
# | |
# ./cria_pasta_nativa.sh novaPasta | |
# | |
ALFRESCO_SERVER=http://servidor:8080/alfresco | |
USERNAME="admin" | |
PASSWORD="senha" | |
#CURL_VERBOSE=-v | |
CURL_VERBOSE=-s | |
CURL_METHOD=POST | |
# tipo nativo Alfresco | |
CONTENTTYPE="cm:folder" | |
NOMEPASTA=$1 | |
#obter o id da pasta onde se deseja criar a nova pasta | |
IDPASTAPAI="0ff86baa-7ae9-464a-8dd6-7f36c1d4d121" | |
CREATE_SERVICE_URL=${ALFRESCO_SERVER}/service/api/node/folder | |
echo "Criando pasta: ""${NOMEPASTA}"" em ${ALFRESCO_SERVER}" | |
curl -X ${CURL_METHOD} --user "${USERNAME}":"${PASSWORD}" "${CREATE_SERVICE_URL}/workspace/SpacesStore/${IDPASTAPAI}" -H "Content-Type: application/json" -d '{"name":"'"${NOMEPASTA}"'"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment